We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
>
Hello. I have a terraform file with the following content:
variable "abc" { type = string validation { condition = length(var.abc) > 2 && can(regex("^[a-z0-9]+$", var.abc)) error_message = "My error message" } }
This fails to load with hcl.load() with the following error message:
hcl.load()
unexpected GT; expected COMMA, IDENTIFIER, STRING, COMMENT, MULTICOMMENT, MINUS, NUMBER, FLOAT, $end, RIGHTBRACE, RIGHTBRACKET, COLON, RIGHTPAREN
After some tests, ternary ifs and inequalities also fail.
resource "random_password" "password" { count = 1 > 2 ? 0 : 1 }
or
resource "random_password" "password" { count = true ? 0 : 1 }
The text was updated successfully, but these errors were encountered:
Works for me. Are you sure you are on updated version?
python-hcl2 4.3.0 lark 1.1.5
{ "variable": [ { "abc": { "type": "${string}", "validation": [ { "condition": "${length(var.abc) > 2 && can(regex(\"^[a-z0-9]+$\", var.abc))}", "error_message": "My error message" } ] } } ] }
Sorry, something went wrong.
I'm sorry, I confused the libraries. I was using another library to parse HCL. Well, time to move to this one :) Sorry about this. Closing the issue.
No branches or pull requests
Hello. I have a terraform file with the following content:
This fails to load with
hcl.load()
with the following error message:unexpected GT; expected COMMA, IDENTIFIER, STRING, COMMENT, MULTICOMMENT, MINUS, NUMBER, FLOAT, $end, RIGHTBRACE, RIGHTBRACKET, COLON, RIGHTPAREN
After some tests, ternary ifs and inequalities also fail.
or
The text was updated successfully, but these errors were encountered: