terraform-linters / tflint

A Pluggable Terraform Linter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`chdir` doesn't respect `.tflint.hcl` from the called directory

amaxine opened this issue · comments

Summary

Prior to the deprecation of accepting path arguments, we relied on keeping a single .tflint.hcl in the root of our Terraform configuration monorepo that got enforced across all configurations. With chdir, this is no longer the case. This is a problem for us, as the default rule set warns on certain behaviour we don't want - for example we enforce provider versions in modules only.

We would like to continue to have a singular configuration for a monorepo, which was possible prior to this change.

Command

tflint --chdir=some/dir

Terraform Configuration

terraform {
  required_providers {
    datadog = {
      source = "DataDog/datadog"
    }
  }
}

TFLint Configuration

plugin "aws" {
  enabled = true
  version = "0.23.1"
  source  = "github.com/terraform-linters/tflint-ruleset-aws"
}

rule "terraform_unused_required_providers" {
  enabled = true
}

rule "terraform_naming_convention" {
  enabled = true
}

rule "terraform_required_providers" {
  enabled = false
}

rule "terraform_required_version" {
  enabled = false
}

Output

N/A

TFLint Version

0.47.0

Terraform Version

1.5.2

Operating System

  • Linux
  • macOS
  • Windows