Skip to content

New serverless pattern - Add REST API Gateway with VPC Link V2 to Private ALB pattern#2868

Open
agawanea wants to merge 6 commits intoaws-samples:mainfrom
agawanea:add-apigw-rest-vpclink-pattern
Open

New serverless pattern - Add REST API Gateway with VPC Link V2 to Private ALB pattern#2868
agawanea wants to merge 6 commits intoaws-samples:mainfrom
agawanea:add-apigw-rest-vpclink-pattern

Conversation

@agawanea
Copy link
Copy Markdown
Contributor

@agawanea agawanea commented Dec 3, 2025

Issue #2869

This pattern demonstrates REST API Gateway integration with a private Application Load Balancer and ECS Fargate cluster using VPC Link V2.

What's included:

  • REST API Gateway with proxy integration
  • VPC Link V2 for private connectivity to ALB
  • Private Application Load Balancer
  • ECS Fargate cluster with nginx
  • Complete security groups and IAM roles
  • Terraform implementation

Tested in: us-east-1

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

agawanea and others added 4 commits December 3, 2025 12:47
- Update prerequisites to specify NAT Gateway only
- Improve 'How it works' section for better clarity
- Fix testing instructions to include path in curl examples
- Fix LinkedIn format to username only
- Update copyright year to 2025
- Use full AWS service names (Amazon API Gateway, Amazon VPC Link V2, Amazon ALB, Amazon ECS)
- Add problem statement explaining VPC Link V2 eliminates NLB requirement
- Update copyright year to 2026
@@ -0,0 +1,29 @@
# Local .terraform directories
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to add a gitignore file at the project level. We have one at the repo level

```
6. Note the output from the Terraform deployment process. These contain the resource names and/or ARNs which are used for testing.

## How it works
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an architecture diagram

{
"title": "REST API Gateway to Private ALB and ECS Fargate via VPC Link V2",
"description": "This pattern demonstrates REST API Gateway integration with a private Application Load Balancer and ECS Fargate cluster using VPC Link V2",
"language": "HCL",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

language should be one of enum values: TypeScript,Node.js,Python,Java,Go,PowerShell,Rust,.NET,OpenAPI,YAML,

"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/apigw-rest-vpclink-pvt-alb-terraform",
"templateURL": "serverless-patterns/apigw-rest-vpclink-pvt-alb-terraform",
"projectFolder": "apigw-rest-vpclink-pvt-alb-terraform",
"templateFile": "apigw-rest-vpclink-pvt-alb-terraform/main.tf"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the projectFolder value from the templateFile

from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it restrictive? This is currently open to everyone

```
cd serverless-patterns/apigw-rest-vpclink-pvt-alb-terraform
```
3. Update the `terraform.tfvars` file with your VPC ID and private subnet IDs:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update or create? I do not see this file included in the repo

@@ -0,0 +1,105 @@
# REST Amazon API Gateway to Private HTTP Endpoint via Amazon VPC Link V2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazon API Gateway REST API to Private ALB via VPC Link V2

@@ -0,0 +1,62 @@
{
"title": "REST API Gateway to Private ALB and ECS Fargate via VPC Link V2",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazon API Gateway REST API to Private ALB via VPC Link V2

@biswanathmukherjee
Copy link
Copy Markdown
Contributor

Hi @agawanea, Are you updating the pattern based on the comments provided?

agawanea and others added 2 commits April 20, 2026 10:51
- Remove project-level .gitignore (repo-level exists)
- Fix title to 'Amazon API Gateway REST API to Private ALB via VPC Link V2'
- Change language from HCL to YAML (valid enum value)
- Remove projectFolder prefix from templateFile
- Restrict ALB security group to VPC CIDR instead of 0.0.0.0/0
- Change 'Update' to 'Create' for terraform.tfvars instructions
- Add architecture diagram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants