virtuald / pyhcl

HCL is a configuration language. pyhcl is a python parser for it.
Mozilla Public License 2.0
334 stars 60 forks source link

Parser failed when reading tf file for aws module #72

Closed amjosuesanchez closed 4 years ago

amjosuesanchez commented 4 years ago

1st error

unexpected IDENTIFIER; expected PERIOD

Caused by

resource "aws_instance" "ldap" {
...
  subnet_id              = var.private_subnets[0]
...
}

2nd error

unexpected ASTERISK_PERIOD; expected NUMBER, MULTICOMMENT, MULTIPLY, MINUS, STRING, COMMENT, LE, NE, LT, COMMA, LEFTBRACKET, IDENTIFIER, $end, GT, DIVIDE, LEFTPAREN, RIGHTBRACE, GE, EQ, QMARK, FLOAT, ADD

Caused by

resource "aws_route53_record" "ldap_int" {
...
records = aws_instance.ldap.*.private_ip
...
}
virtuald commented 4 years ago

That doesn't appear to be valid HCL? Or if it is, maybe it's an HCL2 thing, which wouldn't be supported by this library.

virtuald commented 4 years ago

It is HCL2, which is not supported by pyhcl.