# tflint-ignore-file: terraform_required_version is being ignored #1986
-
SummaryI'm trying to disable a few rule like terraform_required_version in a child Terraform module but tflint-ignore-file: terraform_required_versiondoesn't work at all. TFLint always complains. Commandtflint --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 Configurationconfig {
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 Version0.50.3 Terraform VersionNo response Operating System
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
File level ignore annotations suppress issues that arise with a range from that file. Rules like tflint --format json {
"issues": [
{
"rule": {
"name": "terraform_required_version",
"severity": "warning",
"link": "https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.2/docs/rules/terraform_required_version.md"
},
"message": "terraform \"required_version\" attribute is required",
"range": {
"filename": "",
"start": {
"line": 0,
"column": 0
},
"end": {
"line": 0,
"column": 0
}
},
"callers": []
}
],
"errors": []
} You cannot suppress these issues with annotations and must instead disable the rule via configuration when running against that module. |
Beta Was this translation helpful? Give feedback.
File level ignore annotations suppress issues that arise with a range from that file. Rules like
terraform_required_version
that detect the absence of some recommended declaration inherently have no range to reference.