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

Destroy provisioner each.key #24163

Merged
merged 4 commits into from
Feb 20, 2020
Merged

Destroy provisioner each.key #24163

merged 4 commits into from
Feb 20, 2020

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Feb 19, 2020

Destroy provisioners have access to the each.key value, but they cannot access it by evaluating the for_each expressions and must extract it from the instance address.

Fixes #24139

@jbardin jbardin requested a review from a team February 19, 2020 15:56
@ghost ghost added the sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK label Feb 19, 2020
@jbardin jbardin marked this pull request as ready for review February 19, 2020 15:57
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.

I left some concerns inline about having similar business logic in too spots, but I don't have a concrete suggestion to resolve it, so I'm intending it more as a "do you have any ideas for this?" than a blocker for merging.

terraform/eval_apply.go Outdated Show resolved Hide resolved
Have the InstanceKey implementations handle their own cty.Value
conversions.
During destroy, the for expression may be unknown and evaluation will
fail. Destroy provisioners however can only reference the key value,
which is known in the address.
@jbardin jbardin force-pushed the jbardin/destroy-provisioner-keys branch from 6875ae0 to 0d6b5f1 Compare February 19, 2020 21:03
terraform/eval_apply.go Outdated Show resolved Hide resolved
@jbardin jbardin merged commit bf65b51 into master Feb 20, 2020
@jbardin jbardin deleted the jbardin/destroy-provisioner-keys branch February 20, 2020 13:42
@ghost
Copy link

ghost commented Apr 1, 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 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot destroy for_each null_resource with destroy provisioner within a module
2 participants