terraform: BuiltinEvalContext function eval in partial-expanded module

An earlier commit changed the EvalContext model to support evaluation in
both fully-expanded and partial-expanded modules, but the
provider-contributed functions feature landed semi-concurrently with it
and so inadvertently introduced a codepath that only worked in the
fully-expanded case.

This will now handle both situations, since all we really need is the
addrs.Module, which we can obtain in both modes.
improve-dynamic-block-error-message
Martin Atkins 2 years ago
parent d574082caf
commit 64f7b6992f

@ -489,7 +489,7 @@ func (ctx *BuiltinEvalContext) evaluationExternalFunctions() lang.ExternalFuncs
// by the module author.
ret := lang.ExternalFuncs{}
cfg := ctx.Evaluator.Config.DescendentForInstance(ctx.Path())
cfg := ctx.Evaluator.Config.Descendent(ctx.scope.evalContextScopeModule())
if cfg == nil {
// It's weird to not have a configuration by this point, but we'll
// tolerate it for robustness and just return no functions at all.

Loading…
Cancel
Save