terraform-aws-modules / terraform-aws-apigateway-v2

Terraform module to create AWS API Gateway v2 (HTTP/WebSocket) 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/apigateway-v2/aws
Apache License 2.0
144 stars 188 forks source link

connection_id not set for vpc_links #31

Closed davidkarlsen closed 3 years ago

davidkarlsen commented 3 years ago

Description

Please provide a clear and concise description of the issue you are encountering, your current setup, and what steps led up to the issue. If you can provide a reproduction, that will help tremendously.

⚠️ Note

yes, this has been done

Versions

Terraform v0.15.0 on darwin_amd64

Reproduction

 vpc_links = {
    md-vpc = {
      name               = "md"
      security_group_ids = [module.security-group.this_security_group_id]
      subnet_ids         = var.private_subnet_ids
    }
  }

  integrations = {
    "$default" = {
      description        = "md loadbalancer integration"
      connection_type    = "VPC_LINK"
      integration_uri    = aws_lb_listener.md_lb_listener.arn
      integration_type   = "HTTP_PROXY"
      integration_method = "ANY"
    }
  }

Code Snippet to Reproduce

See above

Expected behavior

Vpc connection_id should be added

Actual behavior

added vpcid manually through ui, it will be removed with apply:

 # module.apigw.aws_apigatewayv2_integration.this["$default"] will be updated in-place
  ~ resource "aws_apigatewayv2_integration" "this" {
      - connection_id          = "3sgwo6" -> null
        id                     = "zbdvzrq"
        # (10 unchanged attributes hidden)
    }

Terminal Output Screenshot(s)

See above

Additional context

api gw, integration through internal NLB lb towards vanilla ec2 instances.

antonbabenko commented 3 years ago

Try to set vpc_link argument in the integrations like shown here: https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2/blob/master/examples/vpc-link-http/main.tf#L69

davidkarlsen commented 3 years ago

Thanks - that works!

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.