Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Basic Scripting help needed for terraform

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".

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

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." : ""
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading