terraform-linters / tflint

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

Failed to check aws_route_not_specified_target on tflint 0.35.0 #1338

Closed Phylu closed 2 years ago

Phylu commented 2 years ago

After upgrading to the latest tflint version, tflint fails on aws_route_not_specified_target with the error unevaluable expression found. This seems to be an issue with the field gateway_id and happens on different places throughout our terraform code. It also affects the AWS VPC module (main.tf, line 206).

$ tflint --module
Failed to check ruleset; Failed to check `aws_route_not_specified_target` rule: unevaluable expression found in .example.tf:11

Example Code

resource "aws_internet_gateway" "gw" {
  vpc_id = aws_vpc.vpc.id
}

resource "aws_route_table" "rt" {
  vpc_id = aws_vpc.vpc.id
}

resource "aws_route" "igw" {
  route_table_id         = aws_route_table.rt.id
  gateway_id             = aws_internet_gateway.gw.id
  destination_cidr_block = "0.0.0.0/0"
}

Version

$ tflint --version
TFLint version 0.35.0
+ ruleset.aws (0.13.0)

$ terraform --version
Terraform v1.1.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.8.0
Phylu commented 2 years ago

I have no idea, how I missed terraform-linters/tflint-ruleset-aws#323. Closed as it is a duplicate.