Skip to content

Commit 4b39231

Browse files
Copilotjtracey93
andcommitted
Expose container_registry_zone_redundancy_enabled as separate top-level variable in ADO and GitHub ALZ modules
By default, the container registry zone redundancy follows the agent/runner container zone support setting. Users can now independently override it by setting container_registry_zone_redundancy_enabled, enabling scenarios like AZ support for runners but not the registry. Co-authored-by: jtracey93 <41163455+jtracey93@users.noreply.github.com>
1 parent cfd9c2f commit 4b39231

4 files changed

Lines changed: 30 additions & 8 deletions

File tree

alz/azuredevops/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module "azure" {
4949
virtual_network_subnet_address_prefix_container_instances = var.virtual_network_subnet_address_prefix_container_instances
5050
virtual_network_subnet_address_prefix_private_endpoints = var.virtual_network_subnet_address_prefix_private_endpoints
5151
storage_account_replication_type = var.storage_account_replication_type
52-
container_registry_zone_redundancy_enabled = var.agent_container_zone_support
52+
container_registry_zone_redundancy_enabled = coalesce(var.container_registry_zone_redundancy_enabled, var.agent_container_zone_support)
5353
public_ip_name = local.resource_names.public_ip
5454
nat_gateway_name = local.resource_names.nat_gateway
5555
use_self_hosted_agents = var.use_self_hosted_agents

alz/azuredevops/variables.tf

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,27 @@ variable "agent_container_memory_max" {
391391

392392
variable "agent_container_zone_support" {
393393
description = <<-EOT
394-
**(Optional, default: `true`)** Enable availability zone support for Azure DevOps agent container instances and container registry.
394+
**(Optional, default: `true`)** Enable availability zone support for Azure DevOps agent container instances.
395395
396-
When enabled, containers are distributed across availability zones for higher availability and resilience,
397-
and the container registry is configured with zone redundancy.
396+
When enabled, containers are distributed across availability zones for higher availability and resilience.
398397
Some regions do not support availability zones, in which case this should be set to false.
399398
EOT
400399
type = bool
401400
default = true
402401
}
403402

403+
variable "container_registry_zone_redundancy_enabled" {
404+
description = <<-EOT
405+
**(Optional, default: `null`)** Enable zone redundancy for the Azure Container Registry.
406+
407+
When enabled, the container registry is replicated across availability zones for higher availability.
408+
Some regions do not support zone redundancy, in which case this should be set to false.
409+
Defaults to the value of `agent_container_zone_support` if not set.
410+
EOT
411+
type = bool
412+
default = null
413+
}
414+
404415
variable "built_in_configuration_file_names" {
405416
description = <<-EOT
406417
**(Optional, default: `["config.yaml", "config-hub-and-spoke-vnet.yaml", "config-virtual-wan.yaml"]`)**

alz/github/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module "azure" {
5050
virtual_network_subnet_address_prefix_container_instances = var.virtual_network_subnet_address_prefix_container_instances
5151
virtual_network_subnet_address_prefix_private_endpoints = var.virtual_network_subnet_address_prefix_private_endpoints
5252
storage_account_replication_type = var.storage_account_replication_type
53-
container_registry_zone_redundancy_enabled = var.runner_container_zone_support
53+
container_registry_zone_redundancy_enabled = coalesce(var.container_registry_zone_redundancy_enabled, var.runner_container_zone_support)
5454
public_ip_name = local.resource_names.public_ip
5555
nat_gateway_name = local.resource_names.nat_gateway
5656
use_self_hosted_agents = var.use_self_hosted_runners

alz/github/variables.tf

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,16 +496,27 @@ variable "runner_container_memory_max" {
496496

497497
variable "runner_container_zone_support" {
498498
description = <<-EOT
499-
**(Optional, default: `true`)** Enable availability zone support for GitHub runner container instances and container registry.
499+
**(Optional, default: `true`)** Enable availability zone support for GitHub runner container instances.
500500
501-
When enabled, containers are distributed across availability zones for higher availability and resilience,
502-
and the container registry is configured with zone redundancy.
501+
When enabled, containers are distributed across availability zones for higher availability and resilience.
503502
Some regions do not support availability zones, in which case this should be set to false.
504503
EOT
505504
type = bool
506505
default = true
507506
}
508507

508+
variable "container_registry_zone_redundancy_enabled" {
509+
description = <<-EOT
510+
**(Optional, default: `null`)** Enable zone redundancy for the Azure Container Registry.
511+
512+
When enabled, the container registry is replicated across availability zones for higher availability.
513+
Some regions do not support zone redundancy, in which case this should be set to false.
514+
Defaults to the value of `runner_container_zone_support` if not set.
515+
EOT
516+
type = bool
517+
default = null
518+
}
519+
509520
variable "runner_name_environment_variable" {
510521
description = <<-EOT
511522
**(Optional, default: `"GH_RUNNER_NAME"`)** The runner name environment variable supplied to the container.

0 commit comments

Comments
 (0)