Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Last active January 20, 2020 10:03
Show Gist options
  • Save AndrewBestbier/7b903e840c225dbc0be22567f3a53503 to your computer and use it in GitHub Desktop.
Save AndrewBestbier/7b903e840c225dbc0be22567f3a53503 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:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/
Handler: create-book.handler
Policies: AmazonDynamoDBFullAccess
Runtime: nodejs12.x
Events:
CreateBook:
Type: Api
Properties:
Path: /books
Method: post
GetBooksFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/
Handler: get-books.handler
Policies: AmazonDynamoDBFullAccess
Runtime: nodejs8.10
Events:
GetBooks:
Type: Api
Properties:
Path: /books
Method: get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment