Problem
Terravision's HCL parser (lark-based) fails to parse valid Terraform HCL when using the && operator in multi-line boolean expressions.
Error Message
Unexpected token Token('__ANON_8', '&&') at line 42, column 5
Followed by a secondary IndexError in graphmaker.py:1457 when splitting resource names (likely due to corrupted parser state).
Sample Code That Fails
locals {
create_monitoring_role = (
var.create_monitoring_role
&& local.db_config.monitoring_role_arn == null
&& local.db_config.monitoring_interval > 0
)
}
This is valid Terraform HCL syntax (terraform validate passes), but terravision cannot parse it.
Environment
- Running via Docker image
patrickchugh/terravision
- Terraform source with Aurora database modules
Workaround
Rewriting the expression as a single line works:
locals {
create_monitoring_role = var.create_monitoring_role && local.db_config.monitoring_role_arn == null && local.db_config.monitoring_interval > 0
}
Expected Behavior
Terravision should parse valid Terraform HCL that uses && operators across multiple lines within parentheses.
Problem
Terravision's HCL parser (lark-based) fails to parse valid Terraform HCL when using the
&&operator in multi-line boolean expressions.Error Message
Followed by a secondary
IndexErroringraphmaker.py:1457when splitting resource names (likely due to corrupted parser state).Sample Code That Fails
This is valid Terraform HCL syntax (
terraform validatepasses), but terravision cannot parse it.Environment
patrickchugh/terravisionWorkaround
Rewriting the expression as a single line works:
Expected Behavior
Terravision should parse valid Terraform HCL that uses
&&operators across multiple lines within parentheses.