diff --git a/infra/azure/main.tf b/infra/azure/main.tf index d91b23e30a9..ec32ff7db28 100644 --- a/infra/azure/main.tf +++ b/infra/azure/main.tf @@ -94,6 +94,7 @@ module "batch" { batch_test_user_storage_account_name = var.batch_test_user_storage_account_name resource_group = data.azurerm_resource_group.rg container_registry_id = azurerm_container_registry.acr.id + storage_account_suffix = var.storage_account_suffix } module "global_config" { @@ -132,4 +133,5 @@ module "ci" { github_context = var.ci_config.github_context ci_and_deploy_github_oauth_token = var.ci_config.ci_and_deploy_github_oauth_token ci_test_repo_creator_github_oauth_token = var.ci_config.ci_test_repo_creator_github_oauth_token + storage_account_suffix = var.storage_account_suffix } diff --git a/infra/azure/modules/batch/main.tf b/infra/azure/modules/batch/main.tf index 47ca3a32a88..4f279d741d1 100644 --- a/infra/azure/modules/batch/main.tf +++ b/infra/azure/modules/batch/main.tf @@ -50,7 +50,7 @@ resource "kubernetes_secret" "batch_worker_ssh_public_key" { } resource "azurerm_storage_account" "batch" { - name = "${var.resource_group.name}batch" + name = "${var.resource_group.name}batch${var.storage_account_suffix}" resource_group_name = var.resource_group.name location = var.resource_group.location account_tier = "Standard" @@ -74,7 +74,7 @@ resource "azurerm_storage_container" "query" { } resource "azurerm_storage_account" "test" { - name = "${var.batch_test_user_storage_account_name}test" + name = "${var.batch_test_user_storage_account_name}test${var.storage_account_suffix}" resource_group_name = var.resource_group.name location = var.resource_group.location account_tier = "Standard" diff --git a/infra/azure/modules/batch/variables.tf b/infra/azure/modules/batch/variables.tf index 8138550ff15..81a9d7ef862 100644 --- a/infra/azure/modules/batch/variables.tf +++ b/infra/azure/modules/batch/variables.tf @@ -13,3 +13,7 @@ variable batch_test_user_storage_account_name { variable container_registry_id { type = string } + +variable storage_account_suffix { + type = string +} diff --git a/infra/azure/modules/ci/main.tf b/infra/azure/modules/ci/main.tf index 3b31d03a182..f3b1eaff1ef 100644 --- a/infra/azure/modules/ci/main.tf +++ b/infra/azure/modules/ci/main.tf @@ -1,5 +1,5 @@ resource "azurerm_storage_account" "ci" { - name = "${var.resource_group.name}ci" + name = "${var.resource_group.name}ci${var.storage_account_suffix}" resource_group_name = var.resource_group.name location = var.resource_group.location account_tier = "Standard" diff --git a/infra/azure/modules/ci/variables.tf b/infra/azure/modules/ci/variables.tf index 0cd8c85cf28..24c8fe95ec0 100644 --- a/infra/azure/modules/ci/variables.tf +++ b/infra/azure/modules/ci/variables.tf @@ -36,3 +36,7 @@ variable "deploy_steps" { variable "github_context" { type = string } + +variable "storage_account_suffix" { + type = string +} diff --git a/infra/azure/modules/db/main.tf b/infra/azure/modules/db/main.tf index 45f6c7ceb65..87b5da35e63 100644 --- a/infra/azure/modules/db/main.tf +++ b/infra/azure/modules/db/main.tf @@ -36,6 +36,8 @@ resource "azurerm_mysql_flexible_server" "db" { # Which availability zone (out of 1,2,3) that the database should be hosted # in. This should ideally match the zone that batch is in but we don't have # availability zones enabled in AKS. + # Sometimes zones are not available in particular regions + # In this case either change to an appropriate zone or comment the below line out zone = 1 delegated_subnet_id = var.subnet_id diff --git a/infra/azure/variables.tf b/infra/azure/variables.tf index b4d1d967c5c..9d08f1cc6c6 100644 --- a/infra/azure/variables.tf +++ b/infra/azure/variables.tf @@ -59,3 +59,7 @@ variable oauth2_developer_redirect_uris { type = list(string) default = [] } + +variable storage_account_suffix { + type = string +}