func NewDynamicValue(val cty.Value, ty cty.Type) (DynamicValue, error) {
	if val == cty.NilVal {
		return DynamicValue(nil), nil
	}
	buf, err := ctymsgpack.Marshal(val, ty)
	if err != nil {
		return nil, err
	}
	return DynamicValue(buf), nil
}
NewDynamicValue creates a DynamicValue by serializing the given value
against the given type constraint. The value must conform to the type
constraint, or the result is undefined.

If the value to be encoded has no predefined schema (for example, for
module output values and input variables), set the type constraint to
cty.DynamicPseudoType in order to save type information as part of the
value, and then also pass cty.DynamicPseudoType to method Decode to recover
the original value.

cty.NilVal can be used to represent the absense of a value, but callers
must be careful to distinguish values that are absent at the Go layer
(cty.NilVal) vs. values that are absent at the cty layer (cty.NullVal
results).
package plans
import (
	"github.com/zclconf/go-cty/cty"
	ctymsgpack "github.com/zclconf/go-cty/cty/msgpack"
)
type DynamicValue []byte