Cloudbox를 사용하여 ObjectCreate
에있는 Lambda 함수를 호출하는 S3 버킷을 배포하려고합니다. 여기 Cloud Formation : S3가 Lambda에 연결하면 ARN이 제대로 형성되지 않습니다.
"ExampleFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Handler": "index.lambda_handler",
"Code": {
"S3Bucket": "bucketname",
"S3Key": "something.zip"
},
"Runtime": "python3.6",
"Role": {
"Fn::GetAtt": [
"LambdaExecutionRole",
"Arn"
]
}
}
},
"InputDataBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "input-data",
"NotificationConfiguration": {
"LambdaConfigurations": [
{
"Function": {
"Ref": "ExampleFunction"
},
"Event": "s3:ObjectCreated:*",
"Filter": {
"S3Key": {
"Rules": [
{
"Name": "suffix",
"Value": "zip"
}
]
}
}
}
]
}
}
},
"LambdaInvokePermission": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"Action": "lambda:InvokeFunction",
"FunctionName": {
"Fn::GetAtt": [
"ExampleFunction",
"Arn"
]
},
"Principal": "s3.amazonaws.com",
"SourceAccount": {
"Ref": "AWS::AccountId"
},
"SourceArn": {
"Fn::Join": [
":",
[
"arn",
"aws",
"s3",
"",
"",
{
"Ref": "InputDataBucket"
}
]
]
}
}
}
. 그러나 지시 사항을 따르면 동일한 오류가 발생합니다. 참고 : 나는 스택을 만들려고 할 때 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html
의 S3는 항상 오류를 나누기 "이 ARN이 잘 형성되지 않는다"
나는 많은 것들을 시도했습니다,하지만 난 항상이 같은 오류가 발생합니다.
초기 CF 작성에서 S3 버킷 및 람다 함수 만 작성한 다음 NotificationConfiguration을 템플릿에 추가하고 마지막으로 CF 업데이트를 수행하고 있습니까? 또한 SourceArn 사용 권한을 얻으려면 "Fn :: GetAtt": [ "InputDataBucket", "Arn"]을 사용하십시오. – jarmod
IAM 역할도 있지만 그 밖의 것은 없습니다. NotificationConf 제거한 다음 그것을 사용하여 업데이트 시도했지만 여전히 동일한 오류가 나타납니다. – Miika