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
Unused variables in Terraform Files #11412
Comments
This! I was just looking for the same thing, where I could clean up unused vars. |
You can use something like: But It would be great to have it integrated onto |
This needs to be a thing!! |
@pecigonzalo ContainerLabs/terraform-unused-vars is gone, do you have any replacements to suggest? |
@dserodio there seems to be a copy of the original ContainerLabs/terraform-unused-vars script within @pecigonzalo 's repo here: https://github.com/pecigonzalo/pre-commit-terraform-vars/blob/master/terraform_unused_vars/__main__.py which worked for me 😄 Still would be great to see this feature built in to Terraform |
Working on adding this to In addition to variables, it will also detect locals and and data sources that have been declared but not referenced. |
I hope terraform would consider what people want faster. Why people should use 3rd party open source tools if it's easily can be implemented with terraform. |
I'm looking for this as well. Incorporating this into 'terraform validate' even if it was an extra argument would be super useful. |
It would be cool to detect unused variables in especially in module files. I usually include a module and check that required parameters for module for how they are used. Sometimes I can see that author is not using a required variable which is simply can be deleted.
The text was updated successfully, but these errors were encountered: