From 6cb81d78c5bc713ec5a1c226ec4cd10af7dd2e84 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Mon, 27 Jan 2025 14:15:17 +0100 Subject: [PATCH] Create ACR without zone redundancy where is not supported --- README.md | 2 +- examples/without_availability_zone/README.md | 1 + examples/without_availability_zone/main.tf | 1 + main.tf | 1 + variables.tf | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b93fc8a..63d68f7 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ object({ name = string private_dns_zone_resource_ids = set(string) subnet_resource_id = string - + zone_redundancy_enabled = optional(bool) }) ``` diff --git a/examples/without_availability_zone/README.md b/examples/without_availability_zone/README.md index 17a76a8..560703d 100644 --- a/examples/without_availability_zone/README.md +++ b/examples/without_availability_zone/README.md @@ -63,6 +63,7 @@ module "test" { name = module.naming.container_registry.name_unique subnet_resource_id = module.avm_res_network_virtualnetwork.subnets["private_link_subnet"].resource_id private_dns_zone_resource_ids = [azurerm_private_dns_zone.this.id] + zone_redundancy_enabled = false } managed_identities = { user_assigned_resource_ids = [ diff --git a/examples/without_availability_zone/main.tf b/examples/without_availability_zone/main.tf index bdf0a75..4529bab 100644 --- a/examples/without_availability_zone/main.tf +++ b/examples/without_availability_zone/main.tf @@ -57,6 +57,7 @@ module "test" { name = module.naming.container_registry.name_unique subnet_resource_id = module.avm_res_network_virtualnetwork.subnets["private_link_subnet"].resource_id private_dns_zone_resource_ids = [azurerm_private_dns_zone.this.id] + zone_redundancy_enabled = false } managed_identities = { user_assigned_resource_ids = [ diff --git a/main.tf b/main.tf index 4e2b1b8..0d0987d 100644 --- a/main.tf +++ b/main.tf @@ -6,6 +6,7 @@ module "avm_res_containerregistry_registry" { location = var.location resource_group_name = var.resource_group_name sku = "Premium" + zone_redundancy_enabled = coalesce(var.acr.zone_redundancy_enabled, true) public_network_access_enabled = false private_endpoints = { primary = { diff --git a/variables.tf b/variables.tf index 0256abd..1475739 100644 --- a/variables.tf +++ b/variables.tf @@ -37,7 +37,7 @@ variable "acr" { name = string private_dns_zone_resource_ids = set(string) subnet_resource_id = string - + zone_redundancy_enabled = optional(bool) }) default = null description = "(Optional) Parameters for the Azure Container Registry to use with the Kubernetes Cluster."