Complete the code to use a conditional expression that sets the instance type to 't2.micro' if the environment is 'dev'.
instance_type = var.environment == "dev" ? [1] : "t2.large"
The conditional expression checks if the environment is 'dev'. If true, it sets the instance type to 't2.micro'. Otherwise, it uses 't2.large'.
Complete the code to set the number of instances to 3 if the region is 'us-east-1', otherwise 1.
count = var.region == "us-east-1" ? [1] : 1
The expression sets 'count' to 3 when the region is 'us-east-1'. Otherwise, it sets 'count' to 1.
Fix the error in the expression that sets 'enable_monitoring' to true only if 'environment' is 'prod'.
enable_monitoring = var.environment [1] "prod" ? true : false
The equality operator '==' is required to compare values in Terraform expressions. Using '=' causes an error.
Complete the code to create a conditional expression that sets 'storage_type' to 'gp2' if 'use_ssd' is true, otherwise 'standard'.
storage_type = var.use_ssd [1] "gp2" : "standard"
The conditional expression uses '?' after the condition and ':' before the else value. This sets 'storage_type' to 'gp2' if 'use_ssd' is true, else 'standard'.
Fill all three blanks to create a conditional expression that sets 'backup_enabled' to true if 'environment' is 'prod' and 'backup_window' is not empty, otherwise false.
backup_enabled = var.environment [1] "prod" [2] var.backup_window [3] "" ? true : false
The expression checks if 'environment' equals 'prod' and 'backup_window' is not empty using '==' and '!=' operators combined with '&&' (and). If both are true, 'backup_enabled' is true; otherwise false.