Open jeremycarroll opened 1 year ago
If you make parentheses for the entire ternary or for only a condition, it works. like those:
resource "aws_instance" "jenkins_controller" {
user_data = var.color == "blue" ? 0 : 1
tags = {
email = (var.assignee == "" ? null : var.assignee)
color = var.color
}
}
or
resource "aws_instance" "jenkins_controller" {
user_data = var.color == "blue" ? 0 : 1
tags = {
email = (var.assignee == "") ? null : var.assignee
color = var.color
}
}
@IButskhrikidze - I am trying to parse all the code in a repo, and it is what it is ... The parser is very close, but even one or two errors cause pain
For me this bug appeared in 4.3.1; downgrading to 4.3.0 fixed it.
I have the same issue with 4.3.1 for a binary operation : priority = 20 + value
.
When downgrading to 4.3.0, everything is OK.
also broken for multi-line ternary even if wrapped in ().
(var.foo ? 1 : 2)
works
this does not
(
var.foo
? 1
: 2
)
I had a parse error that I reduced to
results in
Python 3.11.3; HCL2: 4.3.2