err:=path.NewErrorf("cannot send provider configuration reference to Terraform module input variable")
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Invalid inputs for component",
Detail:fmt.Sprintf(
"Invalid input variable definition object: %s.\n\nUse the separate \"providers\" argument to specify the provider configurations to use for this component's root module.",
tfdiags.FormatError(err),
),
Subject:rng.ToHCL().Ptr(),
Expression:expr,
EvalContext:hclCtx,
})
returncty.DynamicVal,nil
}
returnv,diags
// We actually checked the errors statically already, so we only care about
err:=path.NewErrorf("cannot send provider configuration reference to Terraform module input variable")
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Invalid inputs for component",
Detail:fmt.Sprintf(
"Invalid input variable definition object: %s.\n\nUse the separate \"providers\" argument to specify the provider configurations to use for this component's root module.",
tfdiags.FormatError(err),
),
Subject:rng.ToHCL().Ptr(),
Expression:expr,
EvalContext:hclCtx,
})
}
returnv,diags
}
// EvalExprAndEvalContext evaluates the given HCL expression in the given
// expression scope and returns the resulting value, along with the HCL
// evaluation context that was used to produce it.