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


Launch Stack

Clone repo

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

Deploy

sam deploy --guided


Testing

See the repo for detailed testing notes.

Cleanup

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

Created by:

Greg Davis

Greg Davis

I am a Principal Solutions Architect, Serverless Developer, Database Engineer, and Data Integration Architect. I specialize in architecting and developing Serverless, event-driven solutions.

Follow on LinkedIn