Skip to content

Instantly share code, notes, and snippets.

@RabinMallick
Last active December 1, 2022 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RabinMallick/94f6472c86ed588ed7bdbab203646f61 to your computer and use it in GitHub Desktop.
Save RabinMallick/94f6472c86ed588ed7bdbab203646f61 to your computer and use it in GitHub Desktop.
A sam template with a lambda 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