Skip to content
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 #5082

Closed
ghost opened this issue Jul 5, 2018 · 3 comments
Closed
Labels
upstream-terraform Addresses functionality related to the Terraform core binary.

Comments

@ghost
Copy link

ghost commented Jul 5, 2018

This issue was originally opened by @rahulpatil18 as hashicorp/terraform#18385. It was migrated here as a result of the provider split. The original body of the issue is below.


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

  1. Use data source resource while creating the resource (Terraform deploy)
  2. Destroy the resource which data source is referring to (manual step)
  3. Try to Destroy the resource (Terraform destroy)
@bflad bflad added the upstream-terraform Addresses functionality related to the Terraform core binary. label Jul 5, 2018
@bflad
Copy link
Contributor

bflad commented Jul 5, 2018

Reopened the original issue upstream as this is not provider specific.

@bflad bflad closed this as completed Jul 5, 2018
@divyesh-bg
Copy link

link to the upstream issue please?

@bflad
Copy link
Contributor

bflad commented May 22, 2019

@hashicorp hashicorp locked and limited conversation to collaborators May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet
Development

No branches or pull requests

2 participants