-
Notifications
You must be signed in to change notification settings - Fork 26
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
terraform_unused_required_providers
errors with implicit module passing
#21
Comments
Yes, I've also run into this. Your notes/citations are accurate, this should be allowed. Short of disabling the rule entirely, it seems like walking the module tree and accumulating all required providers will be necessary. This is only an issue when you use environment variables to configure your providers. When a |
And not all providers even need configuration. For example |
Another time that this issue comes up is when the root module passes a provider alias into a child module, and that child module has no resources but implicitly passes to another child module. TF will complain if a module is passed a provider alias but doesn't require that provider, and tf will complain that the required provider is unused even though it is implicitly used by a child module. If that's confusing: root module that sets provider alias > child module with no resources > module with resources |
This comment was marked as off-topic.
This comment was marked as off-topic.
There is no change to the official Terraform guidance, as can be seen looking at that page's GitHub history. |
terraform-linters/tflint#1225 fixed the case where a provider was explicitly passed to a module, but stated:
But this in conflict with the Terraform best practices:
I.e. the root modules should specify a (stricter) version requirement. But
tflint
complains about it.The text was updated successfully, but these errors were encountered: