According to "Working with VPC links for HTTP APIs":
**VPC links **enable you to create private integrations that connect your HTTP API routes to private resources in a VPC, such as Application Load Balancers or Amazon ECS container-based applications.
But:
resource "aws_api_gateway_vpc_link" "example_vpc_link" {
name = "example_vpc_link"
target_arns = [aws_lb.example_lb.arn]
}
resource "aws_lb" "example_lb" {
name = "example-lb"
internal = true
load_balancer_type = "application"
security_groups = [aws_security_group.example_sg.id]
subnets = local.subnet_ids
}
Gives me the error:
│ Error: creating API Gateway VPC Link (example_vpc_link): waiting for completion: FAILED: NLB ARN is malformed
│
│ with aws_api_gateway_vpc_link.example_vpc_link,
│ on main.tf line 139, in resource "aws_api_gateway_vpc_link" "example_vpc_link":
│ 139: resource "aws_api_gateway_vpc_link" "example_vpc_link" {
│
╵
as if aws_api_gateway_vpc_link definitely refers to an NLB not an ALB.
So I assume this is an incomplete set of options for aws_api_gateway_vpc_link in Terraform (no option for target_type = "application"
, and we would need to do a work-around with a custom Terraform resource?