mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Update provider.go
Signed-off-by: keerthanamsys <149489753+keerthanamsys@users.noreply.github.com>
This commit is contained in:
parent
a4149cfa84
commit
36c22eaab4
@ -179,7 +179,7 @@ func (p *Provider) decodeStaticFields(eval *StaticEvaluator) hcl.Diagnostics {
|
||||
return evalContext, diags.Append(evalDiags)
|
||||
}
|
||||
|
||||
forVal, evalDiags := evalchecks.EvaluateForEachExpression(p.ForEach, forEachRefsFunc)
|
||||
forVal, evalDiags := evalchecks.EvaluateForEachExpression(p.ForEach, forEachRefsFunc, nil)
|
||||
diags = append(diags, evalDiags.ToHCL()...)
|
||||
if evalDiags.HasErrors() {
|
||||
return diags
|
||||
@ -187,16 +187,8 @@ func (p *Provider) decodeStaticFields(eval *StaticEvaluator) hcl.Diagnostics {
|
||||
|
||||
p.Instances = make(map[addrs.InstanceKey]instances.RepetitionData)
|
||||
for k, v := range forVal {
|
||||
// Convert boolean keys to strings
|
||||
var keyStr string
|
||||
switch k := k.(type) {
|
||||
case bool:
|
||||
keyStr = fmt.Sprintf("%v", k)
|
||||
default:
|
||||
keyStr = fmt.Sprintf("%v", k)
|
||||
}
|
||||
p.Instances[addrs.StringKey(keyStr)] = instances.RepetitionData{
|
||||
EachKey: cty.StringVal(keyStr),
|
||||
p.Instances[addrs.StringKey(k)] = instances.RepetitionData{
|
||||
EachKey: cty.StringVal(k),
|
||||
EachValue: v,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user