[Docs] Clarify Dependency Management in Style Guide #35259
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was reading through the Terraform docs and got confused by a statement which I believe is unclear or incorrect. This is on the "Style Guide" page under "Code style" (link):
The line above states that dependent resources should be defined after the resources that reference them (so other dependent resources that depend on this dependent resource). However, shouldn't resources always be defined before the resources that reference them? That's what I gather from the "Let your code build on itself" principle and examples elsewhere in the docs.
I think the following change would make this clearer and self-explanatory:
This change clarifies that referenced resources should be defined before the resources that depend on them, which isn't what the original text seems to describe.