Open
Description
Hi,
First of all thanks for developing this library.
I am trying to use this library to read out Terraform in Java and get information about for example variable names & output names.
Maybe I do not understand the intention but I'm trying my code against many public examples of Terraform like https://github.com/futurice/terraform-examples and I notice it often crashes on function calls. One example is:
...
locals {
cleansed_prefix = replace(var.name_prefix, "/[^a-zA-Z0-9]+/", "")
}
...
where it throws an error:
java.lang.ClassCastException: class com.bertramlabs.plugins.hcl4j.symbols.HCLAttribute cannot be cast to class java.lang.String (com.bertramlabs.plugins.hcl4j.symbols.HCLAttribute is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
at com.bertramlabs.plugins.hcl4j.HCLBaseFunctions.lambda$registerBaseFunctions$13(HCLBaseFunctions.java:218)
I had a look at the code and it crashes on the replace
function.
I have two questions basically:
- Why do you run those functions in general already at parsing time?
- Can I somehow turn off all functions? I just want to read out some basic details of the files like input, output, provider names. I don't need all these functions to be actually run.
Metadata
Assignees
Labels
No labels
Activity