mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
strip unknown values from the resource config
Computed values are now all added to the config value as unknowns. Strip these out to match the legacy expatiations.
This commit is contained in:
parent
d6d655f21d
commit
e6478599c6
@ -238,6 +238,11 @@ func NewResourceConfigShimmed(val cty.Value, schema *configschema.Block) *Resour
|
||||
panic(fmt.Errorf("NewResourceConfigShimmed given %#v; an object type is required", val.Type()))
|
||||
}
|
||||
ret := &ResourceConfig{}
|
||||
|
||||
// Computed fields will all be present with unknown values. Strip them out
|
||||
// before passing to the provider.
|
||||
val = cty.UnknownAsNull(val)
|
||||
|
||||
legacyVal := hcl2shim.ConfigValueFromHCL2(val)
|
||||
ret.Config = legacyVal.(map[string]interface{}) // guaranteed compatible because we require an object type
|
||||
ret.Raw = ret.Config
|
||||
|
Loading…
Reference in New Issue
Block a user