Documentation ¶
Index ¶
- Constants
- func ConfigValueFromHCL2(v cty.Value) interface{}
- func HCL2TypeForHILType(hilType ast.Type) cty.Type
- func HCL2ValueFromConfigValue(v interface{}) cty.Value
- func HCL2ValueFromHILVariable(v ast.Variable) cty.Value
- func HILVariableFromHCL2Value(v cty.Value) ast.Variable
- type SingleAttrBody
- func (b SingleAttrBody) Content(schema *hcl2.BodySchema) (*hcl2.BodyContent, hcl2.Diagnostics)
- func (b SingleAttrBody) JustAttributes() (hcl2.Attributes, hcl2.Diagnostics)
- func (b SingleAttrBody) MissingItemRange() hcl2.Range
- func (b SingleAttrBody) PartialContent(schema *hcl2.BodySchema) (*hcl2.BodyContent, hcl2.Body, hcl2.Diagnostics)
Constants ¶
const UnknownVariableValue = "74D93920-ED26-11E3-AC10-0800200C9A66"
UnknownVariableValue is a sentinel value that can be used to denote that the value of a variable is unknown at this time. RawConfig uses this information to build up data about unknown keys.
Variables ¶
This section is empty.
Functions ¶
func ConfigValueFromHCL2 ¶
ConfigValueFromHCL2 converts a value from HCL2 (really, from the cty dynamic types library that HCL2 uses) to a value type that matches what would've been produced from the HCL-based interpolator for an equivalent structure.
This function will transform a cty null value into a Go nil value, which isn't a possible outcome of the HCL/HIL-based decoder and so callers may need to detect and reject any null values.
func HCL2ValueFromConfigValue ¶
HCL2ValueFromConfigValue is the opposite of configValueFromHCL2: it takes a value as would be returned from the old interpolator and turns it into a cty.Value so it can be used within, for example, an HCL2 EvalContext.
Types ¶
type SingleAttrBody ¶
type SingleAttrBody struct { Name string Expr hcl2.Expression }
SingleAttrBody is a weird implementation of hcl2.Body that acts as if it has a single attribute whose value is the given expression.
This is used to shim Resource.RawCount and Output.RawConfig to behave more like they do in the old HCL loader.
func (SingleAttrBody) Content ¶
func (b SingleAttrBody) Content(schema *hcl2.BodySchema) (*hcl2.BodyContent, hcl2.Diagnostics)
func (SingleAttrBody) JustAttributes ¶
func (b SingleAttrBody) JustAttributes() (hcl2.Attributes, hcl2.Diagnostics)
func (SingleAttrBody) MissingItemRange ¶
func (b SingleAttrBody) MissingItemRange() hcl2.Range
func (SingleAttrBody) PartialContent ¶
func (b SingleAttrBody) PartialContent(schema *hcl2.BodySchema) (*hcl2.BodyContent, hcl2.Body, hcl2.Diagnostics)