-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 destroy fails if Data Source referred resource is desroyed manually #18385
Comments
This issue has been automatically migrated to hashicorp/terraform-provider-aws#5082 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#5082. |
@tombuildsstuff I don't think this is specific to aws, any other providers data resource should also exhibit this behavior, am I missing context? |
@bflad thanks, any suggestions or insights into how to solve this, happy to raise PR if its a simple fix |
In a problem that feels related, if you tweak the configuration of a resource to make it invalid, it will no longer destroy. For example, I had this piece of configuration:
I accidentally commented out the
I'm asking Terraform to destroy the resource. Why do I care that my configuration is missing a required field? It feels like both the missing data source issue (which I have also been suffering) and this issue could be related to Terraform fully validating its config before running a destroy. The validation needed before destroying is much slimmer than that needed before planning and applying. |
Hello! 🤖 This issue seems to be covering the same problem or request as #15386, so we're going to close it just to consolidate the discussion over there. Thanks! |
What was the work around to get the destroy to start working as usual? |
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. |
Problem Statement-
If the resource(Lets call it foo) is deployed with the help of data source, If the resource(bar) which is referred by data source is already destroyed by manually or by accident, terraform destroy fails while destroying the resource(foo)
Terraform Version - v0.11.6
For example -
data "aws_security_group" "selected" {
id = "SG-ID"
}
output "group_name" {
value = "${aws_security_group.name}"
}
If we try to destory above resource when resource which id (SG-ID) we provided is no more available, Terraform will fail to destroy the resource
Expected Behavior
It should destroy the resources regardless of resources availbility which are refered by data source.
Actual Behavior
It fails to destroy resources
Steps to Reproduce
The text was updated successfully, but these errors were encountered: