Skip to content

Instantly share code, notes, and snippets.

@jsonw23
Created June 23, 2020 05:27
Show Gist options
  • Save jsonw23/474edc2da55fdf138fc6957170c3d221 to your computer and use it in GitHub Desktop.
Save jsonw23/474edc2da55fdf138fc6957170c3d221 to your computer and use it in GitHub Desktop.
Adding a resource to the template in the SAM sample hello-world project
Resources:
# the hello-world function from the sample project
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.8
Events:
HelloWorld:
Type: Api
Properties:
Path: /hello
Method: get
# a DynamoDB table that we're going to connect to in our function
MyTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment