Commit Graph

4 Commits

Author SHA1 Message Date
James Bardin c7269bec02 Revert "insert empty objects into config from empty blocks"
This reverts commit 3677522a28.
Later changes negate the need for this, and removing these again
prevents us from having to strip them back out when helper/schema
doesn't want them.
2019-01-12 10:41:04 -05:00
James Bardin 3677522a28 insert empty objects into config from empty blocks
When creating a legacy config from a cty.Value, empty nested blocks
should corespond to empty objects in the config.
2019-01-08 15:16:46 -05:00
Martin Atkins 93630cf95f config/hcl2shim: ConfigValueFromHCL2Block function
This is a more specialized version of ConfigValueFromHCL2 which is
specifically for config values that represent the content of a block
body in the configuration.

By using the schema of that block we can more precisely emulate the old
HCL1/HIL behaviors by distinguishing attributes from blocks and applying
some slightly different behaviors for the handling of null values and
of empty collections that are representing the absense of blocks of a
particular type.
2018-10-16 19:14:54 -07:00
Martin Atkins 71e989ba3e config/hcl2shim: make some of the HCL2 shim functions public
The value-conversion machinery is also needed in the main "terraform"
package to help us populate our HCL2 evaluation scope, so a subset of the
shim functions move here into a new package where they can be public.

Some of them remain private within the config package since they depend
on some other symbols in the config package, and they are not needed
by outside callers anyway.
2017-10-16 17:54:02 -07:00