Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: When creating GatewayLoadBalancer VPC Endpoints, AWS Provider does not wait for them to become ready #32774

Open
Sean89us opened this issue Jul 31, 2023 · 1 comment
Labels
bug Addresses a defect in current functionality. service/vpc Issues and PRs that pertain to the vpc service.

Comments

@Sean89us
Copy link

Terraform Core Version

1.4.6

AWS Provider Version

v5.10.0

Affected Resource(s)

AWS VPC endpoints of type GatewayLoadBalancer

Expected Behavior

When creating a GatewayLoadBalancer type VPC endpoint, the AWS provider should wait for the VPC endpoint to reach Available status before marking it as created.

Actual Behavior

The AWS provider creates the VPC endpoint resource correctly but marks the resource as created before the endpoint reaches Available status, leading to errors when referencing the aforementioned VPC endpoint.

Context:
In my example (which is to create a Palo Alto NGFW cloud endpoint), the VPC endpoint being created takes approximately 120-150 seconds to go from Pending to Available status in the AWS console.

As such, when creating a route table that routes to that endpoint, without some sort of delay (such as time_sleep) Terraform will attempt to create the route against the VPC endpoint that is still in Pending status, and it will fail with a misleading error: Route table contains unsupported route target

A second terraform apply run after the VPC endpoint is available will be successful. In order to get around this issue I am currently relying on a time_sleep block that simply waits 3 minutes, and using depends_on to force the route table creation to wait on the VPC endpoint being ready.

Relevant Error/Panic Output Snippet

Error: creating Route in Route Table (rtb-02f8e986bb0f3c207) with destination (0.0.0.0/0): RouteNotSupported: Route table contains unsupported route target: vpce-079b947c19d8fb437. VPC Endpoints of this type cannot be used as route targets.

Terraform Configuration Files

resource "aws_vpc_endpoint" "Ingress_NGFW" {
  vpc_id            = aws_vpc.warp_vpc.id
  service_name      = var.ingress_ngfwe_service_name
  subnet_ids        = [aws_subnet.ingress_ngfw.id]
  vpc_endpoint_type = "GatewayLoadBalancer"
}

resource "aws_route_table" "public_lb_route_table" {
  vpc_id     = aws_vpc.warp_vpc.id

  route {
    cidr_block      = "0.0.0.0/0"
    vpc_endpoint_id = aws_vpc_endpoint.Ingress_NGFW.id
  }
}

Steps to Reproduce

terraform apply the above code

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@Sean89us Sean89us added the bug Addresses a defect in current functionality. label Jul 31, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/vpc Issues and PRs that pertain to the vpc service. needs-triage Waiting for first response or review from a maintainer. labels Jul 31, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/vpc Issues and PRs that pertain to the vpc service.
Projects
None yet
Development

No branches or pull requests

2 participants