Closed schosterbarak closed 4 years ago
hey @aoskotsky-amplify any ideas how can i workaround this one?
What value are you putting in as the argument to file()
?
path to a yaml file
something like:
file("${path.module}/hello.yaml")
Can you add an example hcl2 file thats failing? I tried adding file("${path.module}/hello.yaml")
in one of mine and i'm not getting that error
Getting similar parsing error for:
resource "aws_security_group" "test" {
vpc_id = module.dev_vpc.vpc_id
ingress {
protocol = "tcp"
from_port = 443
to_port = 443
cidr_blocks = [local.vpc.config.vpc_cidr, local.vpc.config.lnk_cidr]
}
ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = [local.vpc.config.vpc_cidr, local.vpc.config.lnk_cidr]
}
ingress {
protocol = "tcp"
from_port = 22
to_port = 22
cidr_blocks = [local.vpc.config.vpc_cidr, local.vpc.config.lnk_cidr]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = merge(local.tags_default, {
Name: "${local.vpc.config.vpc_nickname} test"
})
}
i think it's the ':'
I don't think you are allowed to use :
in hcl objects. It should be Name = "${local.vpc.config.vpc_nickname} test"
. Is that config actually working in Terraform?
I believe this is a Terraform 0.11 vs Terraform 0.12 issue. (See https://www.terraform.io/upgrade-guides/0-12.html#attributes-vs-blocks)
The 0.11 syntax guide describes a map using colons, while 0.12 only has maps with equals signs.
Closing this issue since Terraform 0.11 syntax isn't supported by hcl2. Feel free to reopen this issue if it happens in your Terraform 0.12 configs
this exception happens for parsing a file with
file(x)
function like this one: https://www.terraform.io/docs/configuration/functions/file.html