Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Last active January 12, 2020 18:08
Show Gist options
  • Save AndrewBestbier/e10d318b555024784cd33956d5026437 to your computer and use it in GitHub Desktop.
Save AndrewBestbier/e10d318b555024784cd33956d5026437 to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
DynamoBooksTable:
Type: AWS::Serverless::SimpleTable
Properties:
TableName: books
PrimaryKey:
Name: id
Type: String
CreateBookFunction: # 1
Type: AWS::Serverless::Function # 2
Properties:
CodeUri: src/ # 3
Handler: create-book.handler # 4
Policies: AmazonDynamoDBFullAccess # 5
Runtime: nodejs12.x
Events:
CreateBook: # 6
Type: Api
Properties:
Path: /books #7
Method: post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment