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.
pull/19086/head
Martin Atkins 8 years ago
parent d1d0ede069
commit c06f24b323

@ -227,9 +227,9 @@ func NewResourceConfigShimmed(val cty.Value, schema *configschema.Block) *Resour
}
ret := &ResourceConfig{}
legacyVal := hcl2shim.ConfigValueFromHCL2(val)
legacyVal := hcl2shim.ConfigValueFromHCL2Block(val, schema)
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,
// producing the separate list ComputedKeys to represent these. We use the

Loading…
Cancel
Save