Instantly share code, notes, and snippets.

Embed
What would you like to do?
A sam template with a function and a dynamoDB table
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
AppFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app/index.handler
Runtime: nodejs6.10
Timeout: 60
Events:
ApiEventSource:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
DependsOn: AppTable
AppTable:
Type: "AWS::DynamoDB::Table"
Properties:
AttributeDefinitions:
-
AttributeName: "timestamp"
AttributeType: "N"
KeySchema:
-
AttributeName: "timestamp"
KeyType: "RANGE"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment