From 86a825c1df4c8b7df9a11ec102a8334f03218db1 Mon Sep 17 00:00:00 2001 From: Thierry Lei Date: Fri, 3 May 2024 11:14:55 +0200 Subject: [PATCH] feat(AZ-1405): add ternary condition for `zone_balancing_enabled` parameter --- locals.tf | 4 ++++ resources.tf | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 locals.tf diff --git a/locals.tf b/locals.tf new file mode 100644 index 0000000..7b5c59b --- /dev/null +++ b/locals.tf @@ -0,0 +1,4 @@ +locals { + zone_balancing_enabled = var.sku_name == "Y1" ? false : var.zone_balancing_enabled + worker_count = var.sku_name == "Y1" ? null : var.worker_count +} diff --git a/resources.tf b/resources.tf index d081af4..b7ec7d3 100644 --- a/resources.tf +++ b/resources.tf @@ -6,9 +6,9 @@ resource "azurerm_service_plan" "plan" { os_type = var.os_type sku_name = var.sku_name - zone_balancing_enabled = var.zone_balancing_enabled + zone_balancing_enabled = local.zone_balancing_enabled - worker_count = var.sku_name == "Y1" ? null : var.worker_count + worker_count = local.worker_count maximum_elastic_worker_count = var.maximum_elastic_worker_count app_service_environment_id = var.app_service_environment_id