You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds support for correctly serializing and de-serializing
properties with a Dynamic Type schema. This ensures that properties of
this schema type can be correctly saved to state and then read back with
any provider version.
There are a few changes which had to be made to make this all work:
1. When marshalling values to JSON we now need to pass in the schema
type in order to check if they are Dynamic type. Previously we were
using the value type and assumed the two match. This is not correct for
properties with a Dynamic schema type. We also thread this information
through various places.
2. When recording `RawStateDeltas` (these are the "diffs" between the TF
state and Pulumi state), we need to make sure that properties with a
Dynamic schema type always get a `Replace` delta. This is a full
recording of the TF value, instead of a "diff" with the pulumi state.
This is because the JSON representation of properties with Dynamic
schema type need to contain their value type as well as the value
itself. This is then used to read the state back into the correct
runtime type.
3. Added a `cty` and `hcty` valueshim implementations for the `cty`
package and the Hashi fork of the `cty` package. This is necessary
because the SDKv1 uses the `cty` package while the SDKv2 uses the `hcty`
package. The two implementations are practically identical.
4. Some unit and integration tests to make sure this all works correctly
and stays that way.
fixes#3078
---------
Co-authored-by: Anton Tayanovskyy <[email protected]>
0 commit comments