Amazon API Gateway to AWS Fargate via VPC Link and Network Load Balancer

Amazon API Gateway → VPC Link → NLB → AWS Fargate

This pattern connects a public API Gateway to a private Network Load Balancer to ECS Fargate cluster. It keeps the private subnet resources safe.

This pattern helps connect a public API Gateway endpoint to a private Network Load Balancer alongside an ECS Fargate cluster.
It keeps the private subnet resources safe from exposure and only allows access through a VPC Link, ensuring security.
The pattern will create API Gateway, VPC Link, private Network load balancer, VPC along with a private subnet and a ECS fargate cluster.
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.

< 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-vpclink-pvtnlb-fargate-cdk-python

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

Dinesh Balaaji Prabakaran

Dinesh Balaaji Prabakaran

I am a Senior Technical Account Manager with AWS, I specialize in architecting and developing serverless, event-driven solutions on AWS. AWS Storage Technical Field Community member.

Follow on LinkedIn