Amazon API Gateway HTTP API to AWS Lambda to RDS Proxy

HTTP API → AWS Lambda → RDS proxy instance → Amazon Aurora

Create an HTTP API endpoint that calls a Lambda function to RDS Proxy.

This pattern sets up API Gateway HTTP API using AWS Lambda function as an integration which talks to RDS Aurora(Postgres) via RDS Proxy with IAM Authentication enabled.
The Lambda function uses short-lived credentials to authenticate through RDS proxy via IAM authentication using the popular JavaScript ORM sequelize.

< 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-http-api-lambda-rds-proxy-cdk

Deploy

npm installcdk deploy


Testing

See testing in the README.md file in the repo

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".
3. You see a message confirming DELETE_COMPLETE.

Created by:

Jesse Goeglein

Jesse Goeglein

Jesse is a Cloud Application Architect with AWS Professional Services helping customers succeed with AWS.