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

Add edge when calculating for_each orphans #22454

Merged
merged 5 commits into from
Aug 13, 2019

Conversation

pselle
Copy link
Contributor

@pselle pselle commented Aug 13, 2019

In the scenario when a resource is orphaned by the addition of for_each, in the evaluation of orphans, it is possible for the EachMode of the resource to be set incorrectly, because the last evaluated resource sets the EachMode for the whole resource. As such, adding an edge when evaluating the movement between NoKey and StringKey resources will ensure order is maintained, and an instance with StringKey will "win".

Fixes #22407

@pselle pselle requested a review from a team August 13, 2019 20:58
terraform/transform_orphan_count.go Outdated Show resolved Hide resolved
terraform/transform_orphan_count.go Outdated Show resolved Hide resolved
@pselle pselle merged commit e293176 into hashicorp:master Aug 13, 2019
@ghost
Copy link

ghost commented Sep 13, 2019

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 Sep 13, 2019
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.

Referencing resource instances created by "for_each"
2 participants