Skip to content
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

Override exactly according to the Terraform spec #2124

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Sep 16, 2024

Fixes #2114

TBW

See https://developer.hashicorp.com/terraform/language/files/override#merging-behavior

- Within a top-level block, any nested blocks within an override block replace all blocks of the same type in the original block. Any block types that do not appear in the override block remain from the original block.
- The contents of nested configuration blocks are not merged.
See https://developer.hashicorp.com/terraform/language/files/override#merging-behavior

If more than one override file defines the same top-level block, the overriding effect is compounded, with later blocks taking precedence over earlier blocks. Overrides are processed in order first by filename (in lexicographical order) and then by position in each file.

Regarding the position in each file, no additional considerations are necessary since hclext.Blocks are already sorted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Override files are not compliant with the Terraform spec
1 participant