Summary:"Reference to undeclared provider configuration",
Detail:fmt.Sprintf("There is no provider %q %q block declared this stack.",addr.ProviderLocalName,addr.Name),
Subject:ref.SourceRange.ToHCL().Ptr(),
})
returnnil,diags
}
returnret,diags
casestackaddrs.ContextualRef:
switchaddr{
casestackaddrs.EachKey:
ifrepetition.EachKey==cty.NilVal{
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Invalid 'each' reference",
Detail:"The special symbol 'each' is not defined in this location. This symbol is valid only inside multi-instance blocks that use the 'for_each' argument.",
Subject:ref.SourceRange.ToHCL().Ptr(),
})
returnnil,diags
}
returnJustValue{repetition.EachKey},diags
casestackaddrs.EachValue:
ifrepetition.EachValue==cty.NilVal{
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Invalid 'each' reference",
Detail:"The special symbol 'each' is not defined in this location. This symbol is valid only inside multi-instance blocks that use the 'for_each' argument.",
Subject:ref.SourceRange.ToHCL().Ptr(),
})
returnnil,diags
}
returnJustValue{repetition.EachValue},diags
casestackaddrs.CountIndex:
ifrepetition.CountIndex==cty.NilVal{
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Invalid 'count' reference",
Detail:"The special symbol 'count' is not defined in this location. This symbol is valid only inside multi-instance blocks that use the 'count' argument.",
Subject:ref.SourceRange.ToHCL().Ptr(),
})
returnnil,diags
}
returnJustValue{repetition.CountIndex},diags
casestackaddrs.Self:
ifselfAddr!=nil{
// We'll just pretend the reference was to whatever "self"