Home > Software design >  Terraform Count Functionality Using IF / OR
Terraform Count Functionality Using IF / OR

Time:09-16

I'd like to set the count function for a terraform resource to be dependent on the value of a variable.

In plain English I would like the following...

IF var.domain_name_suffix is equal to "all" OR "GW", Set Count to 1.

ELSE Set count to 0.

CodePudding user response:

I suggest reading the documentation.

count = var.domain_name_suffix == "all" || var.domain_name_suffix == "GW" ? 1 : 0
  • Related