Created
March 13, 2019 22:57
-
-
Save maatthc/4f38b6238cff9d67e3c7401f33670dce to your computer and use it in GitHub Desktop.
Basic AWS SAM template to run NodeJs Lambdas locally: sam local invoke -t sam_template.yml -e test/fixtures/s3-to-lambda-put-event.json
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 | |
Resources: | |
LambdaFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
Runtime: nodejs8.10 | |
MemorySize: 128 | |
Timeout: 15 | |
Environment: | |
Variables: | |
LOG_LEVEL: "debug" |
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
{ | |
"Records": [ | |
{ | |
"eventVersion": "2.1", | |
"eventSource": "aws:s3", | |
"awsRegion": "ap-southeast-2", | |
"eventTime": "2019-02-25T02:25:09.091Z", | |
"eventName": "ObjectCreated:Put", | |
"userIdentity": { | |
"principalId": "AWS:NAH" | |
}, | |
"requestParameters": { | |
"sourceIPAddress": "666.84.43.666" | |
}, | |
"responseElements": { | |
"x-amz-request-id": "PUFT", | |
"x-amz-id-2": "lalaland" | |
}, | |
"s3": { | |
"s3SchemaVersion": "1.0", | |
"configurationId": "666-666", | |
"bucket": { | |
"name": "company-dev-project-app", | |
"ownerIdentity": { | |
"principalId": "MEMYMINE" | |
}, | |
"arn": "arn:aws:s3:::company-dev-project-app" | |
}, | |
"object": { | |
"key": "my_folder/excellent_file.csv", | |
"size": 1310, | |
"eTag": "aabbcc", | |
"sequencer": "00112233" | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment