-
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
resource/aws_route_table: route table is removed from state when it fails to be available (in 2m) on creation #21829
Comments
@ialidzhikov Thanks for raising this issue. I think that Terraform is working as-designed here: terraform-provider-aws/internal/service/ec2/route_table.go Lines 181 to 191 in 6b0c51b
The Terraform resource creation operation has now failed but as an ID was recorded, that resource ( It think the real issue here is that 2 minute timeout. The documentation says:
So, strictly speaking that 2 minutes should be 5 minutes. |
Thank you for your analysis @ewbankkit ! Last week I created #21847 . Let me know if you have comments on it. |
Thank you very much @ewbankkit and all terraform-provider-aws maintainers for having a look into the above PR (sarcasm). Looks like the aws_route create timeout was increased from 2m to 5m with #21531. Hope that this helps with this issue. |
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 - 0.12.31
provider-aws version - 3.63.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
Panic Output
Expected Behavior
aws_route_table resource to be resilient to AWS EC2 consistency issues and to do not remove a route table from the state that will become present in the AWS API after some time.
Actual Behavior
With the above partial configuration we notice that a aws_route_table leaks when it fails to be available (in 2m) on creation.
Here is the output from the first
terraform apply
run:Running terraform apply once again yields the following ouput:
In the second terraform apply run, you can notice that
rtb-1234
is most probably removed from the state.The corresponding code on terraform-provider-aws side that remove the route table from the state if it is not found:
terraform-provider-aws/aws/resource_aws_route_table.go
Lines 225 to 229 in fce7062
After some time we actually notice that both
rtb-1234
andrtb-5678
are present in the AWS API. But they are no longer present in the terraform state because they were most probably removed on refresh.Steps to Reproduce
See above
Important Factoids
References
The text was updated successfully, but these errors were encountered: