terraform-linters / tflint-ruleset-aws

TFLint ruleset for terraform-provider-aws
Mozilla Public License 2.0
336 stars 72 forks source link

`aws_route_not_specified_target` on tflint 0.35.0 #323

Closed ss098 closed 2 years ago

ss098 commented 2 years ago

When I upgraded TFLint to 0.35.0 and ruleset 0.13.0, I got the error.

Failed to check ruleset; Failed to check `aws_route_not_specified_target` rule: unevaluable expression found in public_subnets.tf:60

This code works fine on tflint 0.34.1 and ruleset 0.12.0.

Code

resource "aws_route" "internet" {
  route_table_id         = aws_route_table.main.id
  destination_cidr_block = "0.0.0.0/0"
  gateway_id             = aws_internet_gateway.main.id
}

Version

$ tflint --version
TFLint version 0.35.0
+ ruleset.aws (0.13.0)
$ tflint
Failed to check ruleset; Failed to check `aws_route_not_specified_target` rule: unevaluable expression found in public_subnets.tf:60
mohamed-haidara-cko commented 2 years ago

I have the same error after updating the AWS plugin to 0.13.0.

Code

resource "aws_route" "mgmt_internet" {
  destination_cidr_block = local.full_cidr
  transit_gateway_id     = data.aws_ec2_transit_gateway.mgmt_tg.id
  route_table_id         = data.aws_route_table.mgmt_internet_rt.id
}

Is it possible to not try to evaluate the expression or do we need to ignore the rule is this case?

Phylu commented 2 years ago

According to the error message, this seems to be an issue with the gateway_id field in the resource.

wata727 commented 2 years ago

This issue will be fixed by https://github.com/terraform-linters/tflint-ruleset-aws/pull/320

wata727 commented 2 years ago

This is fixed in v0.13.1 https://github.com/terraform-linters/tflint-ruleset-aws/releases/tag/v0.13.1