Skip to content

terraform_unused_required_providers errors with implicit module passing #21

Open
@tmatilai

Description

@tmatilai

terraform-linters/tflint#1225 fixed the case where a provider was explicitly passed to a module, but stated:

It remains a lint error to declare a required provider when it is implicitly inherited by the child module, as that declaration is the child's responsibility.

But this in conflict with the Terraform best practices:

Terraform Core and Provider Versions

  • Reusable modules should constrain only their minimum allowed versions of Terraform and providers, such as >= 0.12.0. This helps avoid known incompatibilities, while allowing the user of the module flexibility to upgrade to newer versions of Terraform without altering the module.

  • Root modules should use a ~> constraint to set both a lower and upper bound on versions for each provider they depend on.

I.e. the root modules should specify a (stricter) version requirement. But tflint complains about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions