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

Backport of always evaluate module outputs during destroy into v1.5 #33488

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #33462 to be assessed for backporting due to the inclusion of the label 1.5-backport.

The below text is copied from the body of the original PR.


A module output is generally not used during destroy, however it must be evaluated when its value is used by a provider for configuration, because that configuration is not stored between walks.

There was an oversight in the output expansion node where the output node was not created because the operation was destroy, and module outputs have nothing to destroy. This however skipped evaluation when the output is needed by a provider as mentioned above. Because of the way an implied plan is stored internally when executing terraform destroy, this went unnoticed by the test.

Allowing the output to be evaluated during destroy fixes the issue, and should be acceptable because an output is classified as temporary in the graph, and will be pruned when not actually needed.

Update the existing test to serialize the plan, which triggers the failure.

Fixes #33455

@teamterraform teamterraform force-pushed the backport/jbardin/destroy-output-provider-refs/merely-shining-spaniel branch 2 times, most recently from 21cb78d to 148ca3d Compare July 7, 2023 13:44
@jbardin jbardin merged commit 5d890d9 into v1.5 Jul 7, 2023
6 checks passed
@jbardin jbardin deleted the backport/jbardin/destroy-output-provider-refs/merely-shining-spaniel branch July 7, 2023 14:16
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants