I have created my s3 bucket "myBucket" manually.
And I need a lambda function with s3 trigger.
"Parameters": {
"HandlerCodeS3Bucket": {
"Type": "String",
"Default": "myBucket"
},
},
"Resources": {
"uploadBannerToS3Handler": {
"Type": "AWS::Lambda::Function",
"Properties": {
"FunctionName": "uploadBannerToS3",
"Handler": "uploadBannerToS3.handler",
"Role": {
"Fn::ImportValue": {
"Fn::Sub": "${RolesStack}-LambdaRoleArn"
}
},
"Code": {
"S3Bucket": {
"Ref": "HandlerCodeS3Bucket"
},
"S3Key":"uploadBannerToS3.zip"
},
"Layers": [
{
"Ref": "MyLayer"
}
],
"Runtime": "nodejs12.x"
}
}
...
}
How should I modify the code to add s3 trigger in my function.
Also, for development, is it more convenient if I build my s3 bucket in cloudformation also, if I will build my UAT environment in the future?
How would developer normally do for s3 if using cloudformation?