-
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
Terraform should clean up state when deposed instances already terminated #445
Comments
I am experiencing this same thing with aws_nat_gateway resources which no longer exists. After failing to delete the non-existent NAT resource it times out.
|
And same with |
I struggled over what the work-around is for this. A state refresh doesn't help. I finally did a state list to get the exact name of the instance in the state and then did a state rm (remove) for that instance and could finally move on. |
+1 |
This state happens when tf fails on a missing ssh keypair Error: Error applying plan:
1 error(s) occurred:
* aws_instance.ecs: 1 error(s) occurred:
* aws_instance.ecs: Error launching source instance: InvalidKeyPair.NotFound: The key pair 'invalid-keypair-name' does not exist
status code: 400, request id: 2516997c-6384-4d95-8262-7c5333e3b3fb causes a Error: Error applying plan:
1 error(s) occurred:
* aws_instance.ecs: 1 error(s) occurred:
* aws_instance.ecs: InvalidInstanceID.NotFound: The instance ID 'i-061782cf8f1e068d9' does not exist
status code: 400, request id: a16464ff-d296-4b88-ab19-d53388dc703f on the next |
+1 |
+1 |
thanks @practicalint that worked for me:
|
+1 this issue is still present in 0.11 |
@practicalint @matti Removing the state may cause other problems if you already created the new resource.
Cleared deposed section,
to this: finally pushed the state
It fixed the deposed problem with no side effect |
The fix for the original issue of the For issues with other resources or error messages, please open new issues filling out the issue template so we can properly triage. Thanks! |
The fix for the original issue has been released in version 1.55.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I also have the same issue InvalidInstanceID.NotFound: The instance ID 'i-XXXXXX' does not exist Terraform v0.11.10
|
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! |
This issue was originally opened by @kojiromike as hashicorp/terraform#10905. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
0.8.2
Affected Resource(s)
Please list the resources as a list, for example:
Debug Output
Expected Behavior
If tf is trying to destroy instances, and those instances don't exist, this should not be a fatal error.
Actual Behavior
TF halted after it couldn't destroy the nonexistent deposed instances.
The text was updated successfully, but these errors were encountered: