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: multi-var interpolation should use state for count #9361

Merged
merged 1 commit into from
Oct 14, 2016

Conversation

mitchellh
Copy link
Contributor

@mitchellh mitchellh commented Oct 14, 2016

Related to #5254

If the count of a resource is interpolated (i.e. ${var.c}), then it
must be interpolated before any splat variable using that resource can
be used (i.e. type.name.*.attr). The original fix for #5254 is to
always ensure that this is the case.

While working on a new apply builder based on the diff in
f-apply-builder, this truth no longer always holds. Rather than always
include such a resource, I believe the correct behavior instead is to
use the state as a source of truth during walkApply operations.

This change specifically is scoped to walkApply operation
interpolations since we know the state of any multi-variable should be
available. The behavior is less clear for other operations so I left the
logic unchanged from prior versions.

This merge is required for my f-apply-builder branch to pass tests, I'll rebase once it is merged.

Related to #5254

If the count of a resource is interpolated (i.e. `${var.c}`), then it
must be interpolated before any splat variable using that resource can
be used (i.e. `type.name.*.attr`). The original fix for #5254 is to
always ensure that this is the case.

While working on a new apply builder based on the diff in
`f-apply-builder`, this truth no longer always holds. Rather than always
include such a resource, I believe the correct behavior instead is to
use the state as a source of truth during `walkApply` operations.

This change specifically is scoped to `walkApply` operation
interpolations since we know the state of any multi-variable should be
available. The behavior is less clear for other operations so I left the
logic unchanged from prior versions.
@mitchellh mitchellh merged commit 4baed41 into master Oct 14, 2016
@mitchellh mitchellh deleted the b-interp-multi branch October 14, 2016 18:13
@ghost
Copy link

ghost commented Apr 21, 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 21, 2020
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.

2 participants