mirror of
https://github.com/hashicorp/terraform.git
synced 2026-05-28 04:03:27 -04:00
fixup count transition for refresh state
We need to do this for both states during plan
This commit is contained in:
parent
7d6472dad0
commit
ced7aedeca
1 changed files with 6 additions and 2 deletions
|
|
@ -117,8 +117,12 @@ func evaluateCountExpressionValue(expr hcl.Expression, ctx EvalContext) (cty.Val
|
|||
// or this function will block forever awaiting the lock.
|
||||
func fixResourceCountSetTransition(ctx EvalContext, addr addrs.ConfigResource, countEnabled bool) {
|
||||
state := ctx.State()
|
||||
changed := state.MaybeFixUpResourceInstanceAddressForCount(addr, countEnabled)
|
||||
if changed {
|
||||
if state.MaybeFixUpResourceInstanceAddressForCount(addr, countEnabled) {
|
||||
log.Printf("[TRACE] renamed first %s instance in transient state due to count argument change", addr)
|
||||
}
|
||||
|
||||
refreshState := ctx.RefreshState()
|
||||
if refreshState != nil && refreshState.MaybeFixUpResourceInstanceAddressForCount(addr, countEnabled) {
|
||||
log.Printf("[TRACE] renamed first %s instance in transient state due to count argument change", addr)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue