Expand "dynamic" blocks in the given body, returning a new body that has those blocks expanded. The given EvalContext is used when evaluating "for_each" and "labels" attributes within dynamic blocks, allowing those expressions access to variables and functions beyond the iterator variable created b
(body hcl.Body, ctx *hcl.EvalContext, opts ...ExpandOption)
| 43 | // } |
| 44 | // } |
| 45 | func Expand(body hcl.Body, ctx *hcl.EvalContext, opts ...ExpandOption) hcl.Body { |
| 46 | ret := &expandBody{ |
| 47 | original: body, |
| 48 | forEachCtx: ctx, |
| 49 | } |
| 50 | for _, opt := range opts { |
| 51 | opt.applyExpandOption(ret) |
| 52 | } |
| 53 | return ret |
| 54 | } |