Skip to content

Better support and/or documentation for Credentials related to Deep Checking #327

@nshenry03

Description

@nshenry03

From the Deep Checking documentation it says:

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 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:

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.

Would it make sense to use the same exports for project, region, and zone as described in the Google Provider Default Values Configuration documentation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions