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

unused outputs in a destroy should be pruned #17768

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Apr 3, 2018

During a full destroy when outputs are removed, the
NodeDestroyableOutput was preventing it's sibling output from being
destroyed. Prune the output node if it only has its destroy node as a
dependent.

The destroy output test is simply run a second time with no state, which
would cause the output interpolation to fail if it remained in the
graph.

Fixes #17691
Fixes #17655

During a full destroy when outputs are removed, the
NodeDestroyableOutput was preventing it's sibling output from being
destroyed. Prune the output node if it only has its destroy node as a
dependent.

The destroy output test is simply run a second time with no state, which
would cause the output interpolation to fail if it remained in the
graph.
Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Keep iterating until things stop changing" is my favorite type of algorithm in programming language implementations. 😀

@sulabhk
Copy link

sulabhk commented Aug 30, 2018

I'm on Terraform V0.11.8 and get a similar error
TF_WARN_OUTPUT_ERRORS is set to 1, and see an interpolation error when running destroy on an already destroyed environment.

Referred as per the following log https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#0111-november-30-2017


7 error(s) occurred:

* module.gen-db.var.subnet_ids: Resource 'aws_subnet.first_private_subnet' does not have attribute 'id' for variable 'aws_subnet.first_private_subnet.id'
* module.gen-db.var.vpc_id: Resource 'aws_vpc.main' does not have attribute 'id' for variable 'aws_vpc.main.id'
* module.gen-db.var.ingress_security_groups: Resource 'aws_security_group.tomcat' does not have attribute 'id' for variable 'aws_security_group.tomcat.id'
* module.gen-db.var.vpc_security_group_ids: Resource 'aws_security_group.rds-sg' does not have attribute 'id' for variable 'aws_security_group.rds-sg.id'
* module.gen-db.var.zone_id: Resource 'aws_route53_zone.internal' does not have attribute 'zone_id' for variable 'aws_route53_zone.internal.zone_id'
* module.gen-db.var.kms_key_id: Resource 'aws_kms_key.rds' does not have attribute 'arn' for variable 'aws_kms_key.rds.arn'
* module.gen-db.var.db_subnet_group_name: Resource 'aws_db_subnet_group.default' does not have attribute 'id' for variable 'aws_db_subnet_group.default.id'```

@ghost
Copy link

ghost commented Apr 2, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants