-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
config: Report duplicate output
definitions as invalid
#5052
Comments
variable "var1" {
default = "Yoda"
}
variable "var1" {
default = "Pug"
} is reported as valid. |
Yep agreed terraform should protect against these config mistakes. 👍 |
I've looked into this, and have a fix for the output issue. Should we still make a check for duplicate variables ? |
@sorenmat I don't see how duplicate variable definitions can be useful as we'll always pick one at the end... so I'd suggest we check for this too. |
some amount of duplicates need to be supported for https://www.terraform.io/docs/configuration/override.html to work. |
@billf good point, we should definitely have tests covering these cases as these are valid. |
Duplicates in different files should also be invalid. That's the case I'm really worried about as the configurations grow. Is there ever a time where you'd want to re-use a var/output name outside of an override file? |
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The following is currently considered as valid config:
I believe we should be returning error in these cases as outputs are saved as key/value map - i.e. there will always be only 1 unique value returned for a single key.
The text was updated successfully, but these errors were encountered: