Module version
Use-cases
for k, v := range attributes {
d := validateAttributeFieldName(path.AtName(k), k, v)
for k, v := range blocks {
d := validateBlockFieldName(path.AtName(k), k, v)
Since the nested attributes might be done using list, map, or set mode, we'll also need to account for adding those intermediate steps (AtListIndex, AtMapKey, AtSetValue) to the path.
Attempted Solutions
N/A
Proposal
Fix up the path information and consider including it in the diagnostic details in case it is not in Terraform's output. Maybe we can use something like the zero-value (e.g. AtListIndex(0), AtMapKey(""), AtSetValue(/* ? */)) for describing those intermediate path steps for static validation.
References