Multi-Account Setup with Private Amazon API Gateway

Central API Gateway → VPC Link → API Gateway → API Gateway → VPC Link → AWS Lambda → AWS Fargate

Create Private REST API Gateway in multiple accounts and integrate with the central account

This sample project demonstrates how to enable secure, centralized API communications across multiple AWS accounts using a private Amazon API Gateway. It facilitates east/west communication between services while keeping traffic within the AWS network.
The architecture utilizes key AWS services such as Amazon API Gateway (Private), VPC links, Network Load Balancers (NLBs), and Execute-API VPC Endpoints. These services work together to securely route requests between multiple AWS accounts and their respective private APIs.
This pattern deploys three separate AWS accounts: a central account hosting the main API Gateway and routing components, an account with an ECS Fargate service behind a private API Gateway, and another account with a Lambda function integration. Each account contains its own AWS resources to ensure proper communication and isolation.

< 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/multi-account-private-apigw

Deploy

sam deploy --guided --profile PROFILE_NAME


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Usama Ali Khan

Usama Ali Khan

Usama is a Technical Account Manager at Amazon Web Services.

Follow on LinkedIn