I have this local in terraform:
aws-temporary = var.environment == "dev" ? "aws." : ""
now this is called in line:
name = "${var.hostname}.${local.aws-temporary}${data.aws_route53_zone.management_zone.name}"
Now when the "var.environment" is dev .. it does add the ".aws" in the name. However, when it is something else than dev .. it does not add the ".aws".
What I want is that it adds the .aws in dev and other envs.. but not add in dev2.
How would I modify the local to do that? any help would be appreciated. thank you
CodePudding user response:
I would just switch the condition to:
aws-temporary = var.environment == "dev2" ? "" : "aws."
Or another variation of the same:
aws-temporary = var.environment != "dev2" ? "aws." : ""