Update provider.go

Signed-off-by: keerthanamsys <149489753+keerthanamsys@users.noreply.github.com>
This commit is contained in:
keerthanamsys 2025-02-19 15:17:41 +05:30 committed by GitHub
parent 954e3aed01
commit a4149cfa84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,8 +187,16 @@ func (p *Provider) decodeStaticFields(eval *StaticEvaluator) hcl.Diagnostics {
p.Instances = make(map[addrs.InstanceKey]instances.RepetitionData)
for k, v := range forVal {
p.Instances[addrs.StringKey(k)] = instances.RepetitionData{
EachKey: cty.StringVal(k),
// 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),
EachValue: v,
}
}