Enable Lambda function to an S3 bucket using cloudformation

后端 未结 5 697
醉话见心
醉话见心 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条回答
  •  萌比男神i
    2021-01-30 14:29

    i have added below bucket perm along with notificationconfiguration in cloudformation which is used to create S3 bucket..it worked !!

    "bucketperm": {
                "Type": "AWS::Lambda::Permission",
                "Properties": {
                    "Action": "lambda:invokeFunction",
                    "FunctionName": "",
                    "Principal": "s3.amazonaws.com"
                }
    }
    

提交回复
热议问题