terraform-linters / tflint

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

Issue with EOF bracket in terraform code #1030

Closed milijander88 closed 3 years ago

milijander88 commented 3 years ago

With TFLint version 0.23 we have a issue with EOF bracket in our terraform code, the issue is : Failed to check aws_iam_role_policy_invalid_policy rule: main.tf:37,4-4: Unterminated template string; No closing marker was found for the string.

 policy = <<-EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:AttachVolume",
        "ec2:CreateSnapshot",
        "ec2:CreateTags",
        "ec2:CreateVolume",
        "ec2:DeleteSnapshot",
        "ec2:DeleteTags",
        "ec2:DeleteVolume",
        "ec2:DescribeInstances",
        "ec2:DescribeSnapshots",
        "ec2:DescribeTags",
        "ec2:DescribeVolumes",
        "ec2:DescribeVolumesModifications",
        "ec2:DescribeAvailabilityZones",
        "ec2:DetachVolume",
        "ec2:ModifyVolume"
      ],
      "Resource": "*"
    }
  ]
}
EOF
}

This is also one example of the code where we have a issue with EOF bracket

  input = <<DOC
  {
        "ServerId":"${aws_transfer_server.sftp_server.id}"
        }
DOC

Here the name of the issue is : Unterminated template string; No closing marker was found for the string.

So a different type of error that is related to the EOF bracket.

Version

$ tflint -v
TFLint version 0.23.0
+ ruleset.aws (0.1.1-bundled)
$ terraform -v
Terraform v0.12.2

It was working fine on v0.22.0

wata727 commented 3 years ago

Duplicate of #1029