This shows you the differences between two versions of the page.
| programming:conditionalexpressionswithvariables [2024/07/01 10:26] – created kamaradski | programming:conditionalexpressionswithvariables [2024/07/01 10:34] (current) – removed kamaradski | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Conditional Expressions with Variables ====== | ||
| - | Terraform supports conditional expressions that can be used to assign variable values based on conditions. | ||
| - | |||
| - | <code hcl> | ||
| - | variable " | ||
| - | description = " | ||
| - | type = string | ||
| - | } | ||
| - | |||
| - | resource " | ||
| - | ami = " | ||
| - | instance_type = var.environment == " | ||
| - | } | ||
| - | </ | ||