Skip to content

Instantly share code, notes, and snippets.

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 PaulDuvall/18775025c0fea024ce39a55eca8e34cb to your computer and use it in GitHub Desktop.
Save PaulDuvall/18775025c0fea024ce39a55eca8e34cb to your computer and use it in GitHub Desktop.
Use the AWS SAM to define a Serverless Function
Type: 'AWS::Serverless::Function'
Properties:
Handler: index-get.handler
CodeUri: src/
Runtime: nodejs12.x
AutoPublishAlias: live
DeploymentPreference: ...
MemorySize: 128
Policies:
- DynamoDBReadPolicy:
TableName:
Ref: MyDynamoDBTable
Environment:
Variables:
TABLE_NAME:
Ref: MyDynamoDBTable
Events:
GetDataApi:
Type: HttpApi
Properties:
ApiId:
Ref: MyApi
Method: GET
Path: /clouds
TimeoutInMillis: 15000
Description: 'Get data from DynamoDB table'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment