File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ resource "aws_apigatewayv2_route" "root_route" {
3131}
3232
3333# Create a VPC Link
34- resource "aws_apigatewayv2_vpc_link" "example " {
34+ resource "aws_apigatewayv2_vpc_link" "vpc_link " {
3535 name = " ${ var . customer } -vpc-link"
3636 security_group_ids = [var . vpc_link_security_group_id ]
37- subnet_ids = []
37+ subnet_ids = var . subnet_ids
3838}
3939
4040# Integration for the "/" route
@@ -44,6 +44,8 @@ resource "aws_apigatewayv2_integration" "root_integration" {
4444 integration_uri = var. alb_dns
4545 integration_method = " GET"
4646 payload_format_version = " 1.0"
47+ connection_type = " VPC_LINK"
48+ connection_id = aws_apigatewayv2_vpc_link. vpc_link . id
4749}
4850
4951# Integration for the "/api/v1/hi" route
@@ -53,6 +55,8 @@ resource "aws_apigatewayv2_integration" "api_v1_hi_integration" {
5355 integration_uri = " ${ var . alb_dns } /api/v1/hi"
5456 integration_method = " GET"
5557 payload_format_version = " 1.0"
58+ connection_type = " VPC_LINK"
59+ connection_id = aws_apigatewayv2_vpc_link. vpc_link . id
5660}
5761
5862# "dev" stage for the HTTP API
Original file line number Diff line number Diff line change @@ -9,3 +9,11 @@ variable "region" {
99variable "customer" {
1010 type = string
1111}
12+
13+ variable "vpc_link_security_group_id" {
14+ type = string
15+ }
16+
17+ variable "subnet_ids" {
18+ type = string
19+ }
You can’t perform that action at this time.
0 commit comments