-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
NAT Gateways failed during creation and I can't force them to recreate. #8687
Comments
I ran Looking through the code, it looks like if the NAT Gateway fails to come back in time there's only a check for |
I've submitted a PR that I believe should resolve the issue. |
@erutherford thank you! |
Hey folks, I followed those who said to re-apply again which I did but no luck. destroying the whole VPC just made a little difference that the only one created was created in a different AZ but still have same error message. Bearing in mind terrafrom plan shows everything is fine.
|
@ahegazy hi there! The fix in the Pull Request here was to allow for deletion of a NAT Gateway which failed to create (since before once it got stuck, then Terraform would refuse to delete it). In your case, they seem to be failing to create, for some reason, so I would recommend starting with debug output, and then checking AWS console (e.g. CloudTrail) see what the root cause is. You might be running against a limit, etc. |
@kwilczynski You are right, I guess the issue was mainly with the AWS limitation, which I am surprised that Terrafrom should be having some really nicer error messages. |
@ahegazy hi there! Feel free to open a new issue and suggest better error messages. |
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. |
Terraform Version
v0.7.2
Affected Resource(s)
aws_nat_gateway
Expected Behavior
If the NAT Gateways are in a failed state, terraform should discard them and recreate new NAT gateways without having to force this with the
terraform taint
command.Per the API documentation if the state is failed, deleting, or deleted terraform should force it's re-creation.
Actual Behavior
Terraform isn't recognizing the NAT Gateways are in a deleted state and is continuing to use them which will fail because they've been deleted.
Currently, when I run terraform plan there's no output regarding the NAT Gateways needing to be recreated even though they're in a
deleted
state in AWS. If I runterraform apply
terraform fails because it tries to create routes to nat gateways that don't exist.When I ran apply after forcing recreation with a
terraform taint
I getSteps to Reproduce
terraform apply
terraform apply
terraform apply
Important Factoids
Errors from the initial failed run:
The text was updated successfully, but these errors were encountered: