Commit Graph

2 Commits

Author SHA1 Message Date
Martin Atkins 299fe25a04 hcl2shim: Handle unknown values when shimming to/from flatmap
Previously unknown values were round-tripping through flatmap and coming
out as known strings containing the UnknownVariableValue. (The classic bug
that, ironically, was one of the big reasons to write cty!)

Now we properly handle unknown values in both directions: going in to
flatmap we write UnknownVariableValue at the appropriate key (as the count
for sequences or maps) and then coming out of flatmap we turn
UnknownVariableValue back into a cty unknown value of the requested type.
2018-10-16 18:48:28 -07:00
Martin Atkins ccc1b6990f config/hcl2shim: shims from flatmap to cty and vice-versa
These particular shims will have a pretty limited lifetime in mainline
Terraform code (primarily to stub out the new expression evaluator against
the old state structs until the new format is implemented) but will live
on for some time in state migration and provider plugin compatibility
shims.
2018-10-16 18:46:46 -07:00