Enable Lambda function to an S3 bucket using cloudformation

后端 未结 5 641
醉话见心
醉话见心 2021-01-30 13:46

We are creating an S3 bucket using a CloudFormation template. I would like to associate (Add an event to S3 bucket) a Lambda function whenever a file is added to the S3 bucket.

5条回答
  •  孤街浪徒
    2021-01-30 14:17

    It is clearly stated in AWS docs that AWS::S3::Bucket is used to create a resource, If we have a bucket that exists already we can not modify it to add NotificationConfiguration. So S3 bucket must not exist for above template to work. Let CloudFormation creates all resources including S3 bucket.

提交回复
热议问题