Skip to content

Instantly share code, notes, and snippets.

@iDVB
Created August 5, 2019 17:36
Show Gist options
  • Save iDVB/d8d5e2a5818ea5bd2650b794dec74887 to your computer and use it in GitHub Desktop.
Save iDVB/d8d5e2a5818ea5bd2650b794dec74887 to your computer and use it in GitHub Desktop.
Dynamically named S3 Bucket Trigger
Transform: AWS::Serverless-2016-10-31
Resources:
Lambda:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs8.10
InlineCode: |
exports.handler = (event, ctx, cb) => {
console.log(JSON.stringify(event));
cb(null, 'SUCCESS');
};
Handler: index.handler
Events:
PhotoUpload:
Type: S3
Properties:
Bucket: !Ref S3Bucket
Events: s3:ObjectCreated:*
S3Bucket:
Type: AWS::S3::Bucket
# No Properties here at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment