terraform-linters / tflint

A Pluggable Terraform Linter
Mozilla Public License 2.0
4.98k stars 357 forks source link

# tflint-ignore-file: terraform_required_version is being ignored #1985

Closed samrobillard closed 9 months ago

samrobillard commented 9 months ago

Summary

I'm trying to disable a few rule like terraform_required_version in a child Terraform module but

tflint-ignore-file: terraform_required_version

doesn't work at all. TFLint always complains.

Command

tflint --init --fix --config /tflint/config.tflint.hcl && tflint --fix --config /tflint/config.tflint.hcl --chdir=/tflint/tf-code

Terraform Configuration

# tflint-ignore-file: terraform_required_version, terraform_required_providers

##################################################################################
# RESOURCES
##################################################################################
//test tflint auto-fix

module "zscaler" {
  source  = "app.terraform.io/ORG/ORG/azurerm//zscaler"
  version = "2.2.13"

  product_name     = var.product_name
  zpa_domain_names = var.zpa_domain_names
  zpa_tcp_ports    = var.zpa_tcp_ports
  zpa_udp_ports    = var.zpa_udp_ports
}

TFLint Configuration

config {
  module = true
  format = "default"
  call_module_type = "local"
  force = false
  disabled_by_default = false
}

plugin "terraform" {
  enabled = true
  preset  = "recommended"
}

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

Output

##[error]TF LINT ISSUE FOUND IN modules/zscaler
##[error]Warning: terraform "required_version" attribute is required (terraform_required_version)

TFLint Version

0.50.3

Terraform Version

No response

Operating System