Amazon API Gateway REST API to Amazon DynamoDB

API Gateway → Amazon DynamoDB

Create an Amazon API Gateway REST API that integrates with an Amazon DynamoDB table

This pattern creates an Amazon API Gateway REST API that integrates with an Amazon DynamoDB table named "Music". The API includes an API key and usage plan. The DynamoDB table includes a Global Secondary Index named "Artist-Index". The API integrates directly with the DynamoDB API and supports PutItem and Query actions.
The REST API uses an IAM role to provide full access to the specific DynamoDB table and index created by the CloudFormation template.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-rest-api-dynamodb-sls

Deploy

serverless deploy --verbose


Testing

See the repo for detailed testing notes.

Cleanup

1. Delete the stack: serverless remove --verbose.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Dmitry Gulin

Dmitry Gulin

Modernization Architect, AWS

Follow on LinkedIn