Amazon CloudFront to Amazon API Gateway REST API to AWS Lambda to Amazon DynamoDB

Amazon CloudFront → Amazon API Gateway → AWS Lambda → DynamoDB

CloudFront distribution in front of S3 and API Gateway REST API, invoking a Lambda function to store data in DynamoDB.

This sample project creates a simple webform application using Amazon Cloudfront in front of Amazon S3 and Amazon API Gateway REST API. The Amazon API Gateway REST API invokes an AWS Lambda function which stores the webform data in an Amazon DynamoDB table.
This pattern uses AWS WAF to secure the CloudFront distribution and AWS Secrets Manager to store a validation string to validate API requests flow through Amazon Cloudfront. AWS X-Ray is also enabled to allow for distributed tracing.

< 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/cloudfront-apigw-rest-api-lambda-dynamodb-sam

Deploy

sam deploysh deploy_frontend.sh


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

John Dwyer

John Dwyer

I am a Senior Solutions Architect on the Worldwide Public Sector team at AWS. I help customers build and architect serverless applications at scale.

Follow on LinkedIn