-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
VPCLink creation issues (NLB is already associated with another VPC Endpoint Service) #12796
Comments
My guess is that it's the terraform-provider-aws/aws/resource_aws_api_gateway_vpc_link.go Lines 71 to 83 in 41561e8
The VPC link has been created but does not reach the Available state because of the stated error but we are unsetting the ID of the create resource which means it isn't stored to the state file. |
+1 @ewbankkit's suspicion. This also leads to Terraform creating a new (failing) VPC Link for each apply because the created VPC Link is not persisted into the state. |
This has been released in version 3.34.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform v0.12.21
aws provider version 2.54.0
Affected Resource(s)
aws_api_gateway_vpc_link
Terraform Configuration Files
Expected Behavior
I have a load balancer that has already been attached to the vpclink.
I want to provision a new vpclink resource with the same balancer.
Terraform should fail with the appropriate error and write vpclink resource to the state file (since it has been provisioned but failed to start).
terraform destroy command should remove failed vpclink
Actual Behavior
When I try to attach NLB to the new VPCLink using terraform I receive an error:
In fact API Gateway console returns a more convenient error:
VPC link creation failed
NLB is already associated with another VPC Endpoint Service.
When I execute terraform destroy, it does not remove failed VPCLink resource since information about its provisioning wasn't added to the state file (I guess because of error).
Steps to Reproduce
The text was updated successfully, but these errors were encountered: