Open carlosreyna-bread opened 4 years ago
@carlosreyna-bread Hey!
Thanks for trying Variant. Currently, a variable can depend on config, but the opposite is impossible. Do you think we need a real DAG computation among arbitrary combinations of variable and config so that it can be e.g. var a -> config b -> var b -> config c -> ....
?
Also, I was trying to make Variant 2's variable resolution as much similar as possible to Terraform. Do you know if Terraform does support a DAG of e.g. arbitrary local
and `var?
AFAIK, in Terraform, a complex dependency graph like resource
-> provider
-> resource
dependency isn't handled very well, that you usually need terraform apply -target whatever
to cut the graph manually. So probably it won't work for local
and var
as well?
@mumoshu, terraform variables cannot use locals. locals can be used on modules / resources and locals can point to outputs of modules and attributes of resources.
When the local is parsed, it adds the module / resource been used into a dependency and runs the module before the local can be used.
module / resource
-> local
-> module / resource
.
I can see where this would be a lot of complex work, and if it cannot be done, there are work arounds, so it is not a huge deal.
When var is used in a config source job block, it throws an error.
Error message:
Example code that throws error: