Hcl
5 tutorials and guides tagged Hcl on IT Wonder Lab, with step-by-step examples and code you can run.
- Terraform & OpenTofu Tutorials
Terraform Variables, Outputs and Locals Explained with Examples
How to use input variables, validation, outputs and local values in Terraform and OpenTofu, and how to set variables with tfvars files and environment variables.
- Terraform & OpenTofu Tutorials
Terraform and OpenTofu Cheat Sheet: Commands and HCL Syntax
A quick reference of the most used Terraform and OpenTofu commands (init, plan, apply, state, import, workspace) and HCL syntax, with examples to copy.
- Terraform & OpenTofu Tutorials
Terraform Conditionals and for Expressions: Ternary, count, splat and Examples
How to write conditions and loops in Terraform and OpenTofu: the ternary operator, count and for_each switches, for expressions, splat, try, lookup, merge and flatten.
- Terraform & OpenTofu Tutorials
Terraform for_each vs count: Which One to Use and Why
Learn the difference between the Terraform and OpenTofu count and for_each meta-arguments, with AWS examples, and why for_each avoids destroying resources.
- Terraform & OpenTofu Tutorials
Terraform Dynamic Blocks: Generate Nested Blocks from Variables
How to use dynamic blocks in Terraform and OpenTofu to generate repeated nested blocks such as security group rules, with for_each, iterator and AWS examples.