Closed SumGR closed 4 years ago
I found another instance of this error in one of our locals.tf
file:
locals {
/**
* Endpoint mode
*/
has_valid_forwarding_rules_template_inputs = (
length(keys(var.forwarding_rules_template.copy_resolver_rules)) > 0 &&
length(var.forwarding_rules_template.replace_with_target_ips) > 0 &&
length(var.forwarding_rules_template.exclude_cidrs) > 0
)
I get the following:
lark.exceptions.UnexpectedToken: Unexpected token Token(__ANON_0, '\n') at line 5, column 49.
Expected one of:
with the parse error being at the end of has_valid_forwarding_rules_template_inputs = (
The parser has trouble with those statements within the = ()
being stretched over multiple lines. I assume it's the same issue as the other one above?
Good catch. This PR should take care of it. Let me know if it fixes it for you https://github.com/amplify-education/python-hcl2/pull/24
Sorry for the late reply. Yes this fixed our issue. I bumped our project to use python-hcl2==0.2.5
and it works great. Thanks!
I have the following block:
and get the following stack trace:
In this case, line 50 is
for account_name in var.route53_resolver_forwarding_rule_shares[
I think it's having trouble with the arrays split across lines. If I place that entire statement on line line, the parse error goes away. This is valid tf file, at lest with terraform v0.12.18.