mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
core: Use hcl2shimConfigValueFromHCL2Block when shimming ResourceConfig
This ensures more HCL1/HIL-like behaviors when dealing with nested blocks that are not set in the configuration, which is important for compatibility with helper/schema's validation logic.
This commit is contained in:
parent
d1d0ede069
commit
c06f24b323
@ -227,9 +227,9 @@ func NewResourceConfigShimmed(val cty.Value, schema *configschema.Block) *Resour
|
|||||||
}
|
}
|
||||||
ret := &ResourceConfig{}
|
ret := &ResourceConfig{}
|
||||||
|
|
||||||
legacyVal := hcl2shim.ConfigValueFromHCL2(val)
|
legacyVal := hcl2shim.ConfigValueFromHCL2Block(val, schema)
|
||||||
if legacyVal != nil {
|
if legacyVal != nil {
|
||||||
ret.Config = legacyVal.(map[string]interface{}) // guaranteed compatible because we require an object type
|
ret.Config = legacyVal
|
||||||
|
|
||||||
// Now we need to walk through our structure and find any unknown values,
|
// Now we need to walk through our structure and find any unknown values,
|
||||||
// producing the separate list ComputedKeys to represent these. We use the
|
// producing the separate list ComputedKeys to represent these. We use the
|
||||||
|
Loading…
Reference in New Issue
Block a user