Skip to content

Instantly share code, notes, and snippets.

@em-shea
Created November 3, 2023 20:57
Show Gist options
  • Save em-shea/c549a9aef65f469f1ec3c3f9e32216b2 to your computer and use it in GitHub Desktop.
Save em-shea/c549a9aef65f469f1ec3c3f9e32216b2 to your computer and use it in GitHub Desktop.
S3 Lambda example
Transform: AWS::Serverless-2016-10-31
Resources:
SourceBucket:
Type: AWS::S3::Bucket
DestinationBucket:
Type: AWS::S3::Bucket
Function:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/Function
Handler: handler.handler
Runtime: python3.11
Policies:
- S3ReadPolicy:
BucketName: !Ref SourceBucket
- S3WritePolicy:
BucketName: !Ref DestinationBucket
Events:
SourceBucket:
Type: S3
Properties:
Bucket: !Ref SourceBucket
Events:
- s3:ObjectCreated:*
Environment:
Variables:
DESTINATION_BUCKET_NAME: !Ref DestinationBucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment