You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, credentials, regions, etc. declared inside the "google" provider block are not considered except for the project attribute. You need to pass the credentials to TFLint using environment variables and so on.
We also try to avoid adding providers within modules. From the Terraform Providers Within Modules documentation:
A module intended to be called by one or more other modules must not contain any provider blocks. A module containing its own provider configurations is not compatible with the for_each, count, and depends_on arguments that were introduced in Terraform v0.13.
We DO add and configure a provider in examples/simple/main.tf that developers can use for testing.
Is there a way that we can tell tflint to use that provider OR is there a way that we can export the credentials? Looking at the code, the only thing we can set with environment variables (as far as I can tell) is the project, but it seems I also need to set at least zone or region.
Yes. Internally, like the Terraform provider, TFLint uses google.golang.org/api, so you able to use the same environment variables.
On the other hand, if you are developing child modules that are referenced by multiple root modules, deep checking may not make sense. This is because it is always intended to be run in a specific project.
Any improvements to the documentation are welcome!
From the Deep Checking documentation it says:
We use
tflint
pre-commit hooks to test our modules before developers make commits.We also try to avoid adding providers within modules. From the Terraform Providers Within Modules documentation:
We DO add and configure a provider in
examples/simple/main.tf
that developers can use for testing.Is there a way that we can tell
tflint
to use that provider OR is there a way that we can export the credentials? Looking at the code, the only thing we can set with environment variables (as far as I can tell) is the project, but it seems I also need to set at least zone or region.Would it make sense to use the same exports for project, region, and zone as described in the Google Provider Default Values Configuration documentation?
The text was updated successfully, but these errors were encountered: