This update adds a new section explaining conditional expressions in HCL, including syntax, usage examples, and best practices for clarity and maintainability. The documentation covers how to use conditionals for default values, dynamic argument omission, and recommends using locals for complex logic.
Ref: #12806
Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
crt-doc-update
Ryan Johnson10 months agocommitted byJenna Goldstrich
HCL allows the use of expressions to access data exported
by sources and to transform and combine that data to produce other values.
HCL expressions provide access to data exported by data sources and transforms and combines the data into other values. Learn how to use HCL expressions in Packer templates.
---
# Expressions
@ -142,6 +141,106 @@ The following named values are available:
For a full list of available functions, see [the function