-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_route: route is not saved in the state when it fails to be available (in 10m create timeout) #23827
Comments
terraform-provider-aws/internal/service/ec2/route.go Lines 228 to 248 in 7fc82c0
|
@ewbankkit, I'd like to work on this. The fix itself seems straight forward. But I am not sure how we can write an acceptance test for this. I was trying to understand if we could mock the |
Just running the current set of acceptance tests should suffice. |
When the route's wait-for-creation operation times out, its state is leaked as `d.SetId(...)` is called after the `WaitRouteReady(...)`. So, the next time the configuration is applied, the Terraform engine tries to create the same route again, getting duplication error from AWS. Call `d.SetId(...)` before `WaitRouteReady(...)`. Fixes: hashicorp#23827
Issue: When the route's wait-for-creation operation times out, its state is leaked as `d.SetId(...)` is called after the `WaitRouteReady(...)`. So, the next time the configuration is applied, the Terraform engine tries to create the same route again, getting duplication error from AWS. Fix: Call `d.SetId(...)` before `WaitRouteReady(...)`. Fixes: hashicorp#23827
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
terraform version - 1.5.1
provider-aws version - 4.6.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
NA
Panic Output
NA
Expected Behavior
I expect that terraform-provider-aws saves the route in the state and waits for it to get ready. And terraform apply fails when the route cannot be available (in 10m) but the route is saved in the state and no state is lost/leaked.
Actual Behavior
On first run, Terraform starts creating the routes in batches (lets say 8 out of 26 routes at a time) & later fails to add the route even with the long create timeout.
Error message is also misleading-
On next plan & apply, terraform gives the below error-
Steps to Reproduce
terraform apply
Important Factoids
NA
References
The text was updated successfully, but these errors were encountered: