Last active
September 11, 2017 12:49
-
-
Save rts-rob/9e5a01bd05ff6478061c4c00743a6e44 to your computer and use it in GitHub Desktop.
Simple SAM example with one DynamoDB table and one Lambda function
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: | |
someTable: | |
Type: 'AWS::DynamoDB::Table' | |
Properties: | |
AttributeDefinitions: | |
- AttributeName: id | |
AttributeType: S | |
- AttributeName: version | |
AttributeType: 'N' | |
KeySchema: | |
- AttributeName: id | |
KeyType: HASH | |
- AttributeName: version | |
KeyType: RANGE | |
ProvisionedThroughput: | |
ReadCapacityUnits: 5 | |
WriteCapacityUnits: 5 | |
StreamSpecification: | |
StreamViewType: NEW_AND_OLD_IMAGES | |
someFunction: | |
Type: 'AWS::Serverless::Function' | |
Properties: | |
Handler: someFunction.handler | |
Runtime: nodejs6.10 | |
CodeUri: . | |
Policies: [] | |
Events: | |
Tablet1: | |
Type: DynamoDB | |
Properties: | |
Stream: !GetAtt someTable.StreamArn | |
StartingPosition: TRIM_HORIZON | |
BatchSize: 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment