Terraform multi ternary condition

  Kiến thức lập trình

I have referred old questions but still not getting correct value for ‘qa’ environment.
For dev environment, it is giving correct value.

I have tried different ways but still not getting correct value for ‘qa’ environment.
For qa environment, it is giving value ‘x’ instead of expected value ‘q’.
I didn’t check for ‘uat’ and ‘prod’ environment cases and using this in locals.tf.

envsymbol = var.environment == “dev” ? “d” : (var.environment == “qa” ? “q”) : (var.environment == “uat” ? “u” : “p”)

envsymbol = var.environment == “dev” ? “d” : var.environment == “qa” ? “q” : var.environment == “uat” ? “u” : var.environment == “prod” ? “p” : “x”

envsymbol = var.environment == “dev” ? “d” : (var.environment == “qa” ? “q” : (var.environment == “uat” ? “u” : (var.environment == “prod” ? “p” : “x”)))
}

please suggest me to modify this to get correct value ‘q’ for ‘qa’ environment.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT