Amazon API Gateway Private API with AWS Lambda

API Gateway → AWS Lambda

Create an Amazon API Gateway Private API with AWS VPC Lambda proxy integration

This pattern in CDK offers a example to generate an Amazon API Gateway Private API endpoint with a greedy proxy ("{proxy+}") and "ANY" method from the specified path, meaning it will accept by default any method and any path. The VPC Lambda function provided in JavaScript only returns the path.

< 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/private-apigw-lambda-cdk

Deploy

npx cdk bootstrap aws://accountnumber/regionnpx cdk deploy --app 'ts-node .' --all


Testing

See the GitHub repo for detailed testing instructions.

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:

Rajneesh Ranjan

Rajneesh Ranjan

Rajneesh works at AWS Professional Services and is a Serverless and Container enthusiast.

Britney Tong

Britney Tong

Britney is an Professional Service and a Serverless enthusiast at Amazon Web Services based in Austin, US. Prior to joining AWS Britney worked in a number of different technical roles specializing in IoT integration, workflow Automation, and Platform as a Service (PaaS).