简体   繁体   中英

Terraform Count Functionality Using IF / OR

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.

I suggest reading the documentation .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM