# Mustache IF ELSE loop

**URL:** <https://forum.opensearch.org/t/mustache-if-else-loop/4219>\
**Category:** Build\
**Created:** [November 17, 2020, 5:06am UTC](https://forum.opensearch.org/t/mustache-if-else-loop/4219 "2020-11-17T05:06:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kranaa](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@kranaa](https://forum.opensearch.org/u/kranaa)\
**Post date:** [November 17, 2020, 5:06am UTC](https://forum.opensearch.org/t/mustache-if-else-loop/4219/1 "2020-11-17T05:06:09Z")

</div>

Hi,  
I am trying to implement IF - ELSE in mustache on an existing condition for ECS service which is working,

desired count = “${var.dr\_region == var.region ? 0 : {{initial\_capacity}}}”

what I am looking for is, in the very same condition what I am trying to implement is if dr region is not equal to region I want to give another count. some thing like this which doesnt work

desired count = “${var.dr\_region == var.region ? 0 : {{initial\_capacity}} && var.dr\_region != var.region ? 0 : {{maximum\_capacity}}}”

can someone help me on how to solve this?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![kris](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/kris/32/2208_2.png) [@kris](https://forum.opensearch.org/u/kris)\
**Post date:** [February 7, 2023, 6:38pm UTC](https://forum.opensearch.org/t/mustache-if-else-loop/4219/2 "2023-02-07T18:38:21Z")

</div>


