-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document behavior/validation limitations of nested attributes vs blocks #810
Comments
While adding documentation around this is likely valid in some form, since it is an explicit behavior of Terraform, I believe we need to be careful about not confusing provider developers further. It is awkward for provider developers to choose how they believe practitioners should have to design their configurations since working with blocks is explicitly much harder and working with attributes is much easier. This really feels like a concern to be solved in the configuration validation/linting space, if a practitioner feels it is important. Provider developers should not be burdened with concerns outside of defining what is valid for their data input. If you have proposals for specific wording and/or placement of that wording, it is certainly welcome feedback. |
Based on the discussion of tradeoffs in hashicorp/terraform#33570, my suggestion would be to add a table to the nested attribute docs and reference it from the block docs, with the tradeoffs discussed listed:
etc. |
The maintainers have discussed this further with the Terraform core team and we all have decided that adding provider developer documentation that seems to discourage nested attributes usage is not preferable. While there is inherent risk that an attribute name typo may be introduced in a practitioner configuration, the resource plan should convey what data values are correctly being handled and the configuration benefits/ease for practitioners is generally worth the tradeoff. To that end, the preference here will be to leave the documentation as-is and monitor for similar developer reports to discover whether additional documentation in this area is warranted. Thank you for raising this. 👍 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Module version
Use-cases
When creating a terraform provider, the current document suggests the blocks should not be used:
However, there are some validation differences:
Attempted Solutions
Reported as a bug here in #805 to terraform in hashicorp/terraform#33570, however, this can't be addressed in the near term for compatibility: hashicorp/terraform#33570 (comment)
Proposal
Documentation should be updated to include notes on the validation behavior of blocks compared to nested attributes.
References
The text was updated successfully, but these errors were encountered: