Skip to content
New issue

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

What is the HCL standard library? Is this documented anywhere? #2958

Closed
MorganR opened this issue Jul 13, 2024 · 2 comments
Closed

What is the HCL standard library? Is this documented anywhere? #2958

MorganR opened this issue Jul 13, 2024 · 2 comments

Comments

@MorganR
Copy link

MorganR commented Jul 13, 2024

I have noticed that HCL has a standard library that seems to provide various functions, and I've seen examples of more advanced syntax such as the for loop in this comment, but I can't find this documented anywhere.

I apologise in advance if I'm just being a bit thick. Is there anywhere that these functions and basic syntax, like for loops and conditionals, are documented for HCL? I can find very few examples of this sort of dynamic functionality in the docs or guides.

I'm ultimately hoping that I can conditionally set some local variables based on the value of atlas.env.

@kav
Copy link

kav commented Aug 13, 2024

I don't know that everything here works in Atlas but this is my reference for things to try: https://developer.hashicorp.com/terraform/language

I do know for conditionals ternaries work as described here:
https://developer.hashicorp.com/terraform/language/expressions/conditionals

I didn't seem to have access to atlas.env outside the atlas.hcl file in my testing but I'll admit it was pretty shallow

@MorganR
Copy link
Author

MorganR commented Nov 2, 2024

Perfect, thanks! Had somehow not made the connection that this was the same HCL

@MorganR MorganR closed this as completed Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants