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

Report & correct duplicate variable definitions across auto-loaded tfvars files #702

Open
2 tasks
radeksimko opened this issue Nov 8, 2021 · 0 comments
Open
2 tasks

Comments

@radeksimko
Copy link
Member

radeksimko commented Nov 8, 2021

Use-cases

Users with more complex modules and many variables may not always notice duplicate entries across multiple autoloaded variable files.

For example, say we have the following variable files with variable definitions:

  • alpha.auto.tfvars - one, two
  • beta.auto.tfvars - three
  • gama.auto.tfvars - one, four

User may not notice the one being declared twice in alpha.auto.tfvars and gama.auto.tfvars until they run terraform validate or plan or similar command.

Attempted Solutions

Manual inspection, or terraform validate.

Proposal

  • Report duplicates (across any auto-loaded *.tfvars and *.tfvars.json files) as diagnostics
  • Provide code action to remove duplicates (user is given a choice to decide which one to keep)
@radeksimko radeksimko changed the title Report duplicate variable definitions across auto-loaded tfvars files Report & action duplicate variable definitions across auto-loaded tfvars files Dec 20, 2023
@radeksimko radeksimko changed the title Report & action duplicate variable definitions across auto-loaded tfvars files Report & correct duplicate variable definitions across auto-loaded tfvars files Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants