Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: storage accounts weren't unique. Added prefix. Fixed zone bug in… #294

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions infra/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions infra/azure/modules/batch/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions infra/azure/modules/batch/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ variable batch_test_user_storage_account_name {
variable container_registry_id {
type = string
}

variable storage_account_suffix {
type = string
}
2 changes: 1 addition & 1 deletion infra/azure/modules/ci/main.tf
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 4 additions & 0 deletions infra/azure/modules/ci/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ variable "deploy_steps" {
variable "github_context" {
type = string
}

variable "storage_account_suffix" {
type = string
}
9 changes: 8 additions & 1 deletion infra/azure/modules/db/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ 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.
zone = 1
# Commented out due to the following error:
# │ Error: waiting for creation of Flexible Server: (Name "db-2138b3b3" / Resource Group "hail"): Code="AvailableZoneNotFound" Message="The availiabilityZone '1' is not found for subscription id '4453ab2e-2015-4bf0-adf2-7b2fa1f207e3'."
# │
# │ with module.db.azurerm_mysql_flexible_server.db,
# │ on modules/db/main.tf line 22, in resource "azurerm_mysql_flexible_server" "db":
# │ 22: resource "azurerm_mysql_flexible_server" "db" {
# │
# zone = 1

delegated_subnet_id = var.subnet_id
private_dns_zone_id = azurerm_private_dns_zone.db.id
Expand Down
4 changes: 4 additions & 0 deletions infra/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ variable oauth2_developer_redirect_uris {
type = list(string)
default = []
}

variable storage_account_suffix {
type = string
}