Created
May 25, 2021 23:10
-
-
Save anderson-marques/eccb00571f726cb2c965ed27b4cb7a2f to your computer and use it in GitHub Desktop.
SAM Template using S3 Event Source - Hypothetical CustomerEventsProcessor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
SAM Template - Example of S3 Event processing | |
Process related events: CustomerCreated, CustomerDeleted, CustomerUpdated | |
Parameter: | |
DataLakeBucket: | |
Type: String | |
Default: com-mycompany-datalake-bucket | |
Resources: | |
CustomerEventsProcessor: | |
Type: AWS::Serverless::Function | |
Properties: | |
Runtime: nodejs14.x | |
Handler: /build/customer-events-processor.handler | |
CodeUri: . | |
Policies: | |
- S3ReadPolicy: | |
BucketName: !Ref DataLake | |
Events: | |
CustomerEventReceived: | |
Type: S3 | |
Properties: | |
Bucket: !Ref DataLakeBucket | |
Prefix: "Customer*" | |
Events: s3:ObjectCreated:* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment