terraform-linters / tflint

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

Rules that internally error cannot be ignored #1173

Closed hs-amartin closed 3 years ago

hs-amartin commented 3 years ago

There is a bug in this rule that internally errors when there is no message to check. However if you attempt to ignore either in your .tflint, via command line args, or inside the file, the ignore is ignored.

resource "aws_cognito_user_pool" "this" {
  #tflint-ignore:aws_cognito_user_pool_invalid_email_verification_message
  count = var.create ? 0 : 1
  name  = "Testing"
}
terraform {
  required_version = "~> 1.0"

  required_providers {
    aws = {
      source                = "hashicorp/aws"
      version               = "~> 3.0"
    }
  }
}

Version

$ tflint -v
TFLint version 0.30.0
+ ruleset.aws (0.5.0)
$ terraform -v
Terraform v1.0.1
bendrucker commented 3 years ago

This is the intended behavior. Only config issues raised by rules can be ignored, not errors. It is typically not possible to associate an ignore instruction with an unexpected error because the error will not have any associated position info to match.

If there's a bug in a rule preventing you from using it, you'll need to disable the rule until it's fixed.