Skip to content

Instantly share code, notes, and snippets.

@rts-rob
Created September 11, 2017 12:38
Show Gist options
  • Save rts-rob/7adb1102d1c1d1bd619ed5329071276e to your computer and use it in GitHub Desktop.
Save rts-rob/7adb1102d1c1d1bd619ed5329071276e to your computer and use it in GitHub Desktop.
Simple Serverless Framework example with one DynamoDB table and one Lambda function
service: serverless
provider:
name: aws
runtime: nodejs6.10
functions:
someFunction:
handler: someFunction.handler
description: Lambda Function
events:
- stream:
type: dynamodb
arn:
'Fn::GetAtt':
- someTable
- StreamArn
resources:
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
Outputs: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment