Documentation ¶
Overview ¶
Package tfhcl is a fork of hcl/ext/dynblock. Like dynblock, it supports dynamic block expansion, but also resource expansion via count/for_each meta-arguments. This package is defined separately from hclext because meta-arguments are a Terraform concern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
func Expand(body hcl.Body, ctx *hcl.EvalContext) hcl.Body
Expand "dynamic" blocks and count/for_for_each meta-arguments resources in the given body, returning a new body that has those blocks expanded.
The given EvalContext is used when evaluating attributes within the given body. If the body has a dynamic block or an expandable resource, its contents are evaluated immediately.
Expand returns no diagnostics because no blocks are actually expanded until a call to Content or PartialContent on the returned body, which will then expand only the blocks selected by the schema.
func ExpandVariablesHCLExt ¶
func ExpandVariablesHCLExt(body hcl.Body, schema *hclext.BodySchema) []hcl.Traversal
ExpandVariablesHCLExt is a wrapper around dynblock.WalkVariables that uses the given hclext.BodySchema to automatically drive the recursive walk through nested blocks in the given body.
Note that it's a wrapper around ExpandVariables, not WalkExpandVariables. This package evaluates expressions immediately on expansion, so we always need all variables to expand. It also implicitly walks count/for_each to support expansion by meta-arguments.
func MakeCountIteration ¶
func MakeForEachIteration ¶
Types ¶
This section is empty.