I\'m trying to create an S3 trigger for a Lambda function in a CloudFormation Template. The S3 bucket already exists, and the Lambda function is being created.
This
I use another solution because personally I don't like custom resource. I create a cloud trail to capture S3 write events for the concerned bucket, then I create a cloudwatch/eventbridge rule with S3 event pattern to trigger my Lambda function. This way I can hook my Lambda function to an existing S3 bucket without touching it, and it can be easily done through cloudformation.