REST API with Amazon API Gateway, Amazon RDS and AWS Lambda with SnapStart

REST API → AWS Lambda → RDS Postgres

A pattern to show how to use Lambda SnapStart with relational databases.

CDK creates all the infrastructure we need for the pattern, include the VPC, subnets, security groups,secrets and the DB.
The DB setup Lambda function is executed once to create the database table with a given structure.
This REST API is implemented with the Micronaut framework. Credentials for the DB are passed as environment variables to the application.

< 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-lambda-rds-snapstart

Deploy

cdk deploy --all


Testing

See the README in the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy --all.

Created by:

Mark Sailes

Mark Sailes

Senior Specialist SA, Serverless at AWS and Java fan.

Follow on LinkedIn