Skip to content

Handle Nested Attributes and Nested Blocks Using List, Set and Map When Validating Attribute Field Names #574

@bendbennett

Description

@bendbennett

Module version

v0.17

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions