Introduction
Sometimes you want to choose between two values based on a condition in your infrastructure code. Conditional expressions let you do this simply and clearly in Terraform.
When you want to set a resource property differently depending on an environment variable.
When you need to choose between two instance types based on a cost-saving flag.
When you want to enable or disable a feature based on a boolean input.
When you want to assign a tag value conditionally depending on a deployment stage.
When you want to select a subnet ID based on whether the deployment is in production or testing.