Enable Lambda function to an S3 bucket using cloudformation

后端 未结 5 639
醉话见心
醉话见心 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:36

    Yes, it's possible through Cloudformation, and what you need to configure are:

    1) AWS::S3::Bucket resource and,

    2) NotificationConfiguration configuration (use LambdaConfigurations in this case) for the s3 resource above.

    Related documentation that you need:

    https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-notification

    https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html

提交回复
热议问题