Skip to content

Instantly share code, notes, and snippets.

@managedkaos
Created October 8, 2025 20:57
Show Gist options
  • Save managedkaos/77c9ef2c0e4aa85417c2c3bab427317c to your computer and use it in GitHub Desktop.
Save managedkaos/77c9ef2c0e4aa85417c2c3bab427317c to your computer and use it in GitHub Desktop.
Resources:
ImagesBucket:
Type: AWS::S3::Bucket
ResizeQueue:
Type: AWS::SQS::Queue
S3ToSQS:
Type: AWS::S3::Bucket
Properties:
NotificationConfiguration:
QueueConfigurations:
- Event: s3:ObjectCreated:*
Queue: !GetAtt ResizeQueue.Arn
DependsOn: ImagesBucket # wire notifications to the same bucket
# (In practice, attach this config to ImagesBucket; shown split for brevity)
ImageResizer:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.11
Handler: app.handler
Events:
FromQueue:
Type: SQS
Properties:
Queue: !GetAtt ResizeQueue.Arn
Policies:
- S3ReadPolicy:
BucketName: !Ref ImagesBucket
- S3WritePolicy:
BucketName: !Ref ImagesBucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment