From f137aeee54debb581b715c08d21270d3da179e70 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 19 Mar 2024 12:12:59 +0000 Subject: [PATCH 01/28] Initial Commit --- .../admin-vm/template_schema.json | 3 +- .../gitea/terraform/gitea-webapp.tf | 4 +- .../shared_services/gitea/terraform/locals.tf | 6 +++ .../shared_services/gitea/terraform/mysql.tf | 40 ++++++++----------- .../gitea/terraform/variables.tf | 4 ++ .../workspace_services/gitea/porter.yaml | 2 +- .../gitea/terraform/gitea-webapp.tf | 4 +- .../gitea/terraform/locals.tf | 6 +++ .../gitea/terraform/mysql.tf | 38 ++++++++---------- .../gitea/terraform/variables.tf | 3 ++ .../workspace_services/gitea/version.txt | 2 +- .../mysql/terraform/mysql.tf | 38 ++++++++---------- .../mysql/terraform/outputs.tf | 2 +- 13 files changed, 77 insertions(+), 75 deletions(-) diff --git a/templates/shared_services/admin-vm/template_schema.json b/templates/shared_services/admin-vm/template_schema.json index d644d49be7..129ca5f1c1 100644 --- a/templates/shared_services/admin-vm/template_schema.json +++ b/templates/shared_services/admin-vm/template_schema.json @@ -13,7 +13,8 @@ "Standard_B2s", "Standard_D2s_v3", "Standard_D2s_v4", - "Standard_D2s_v5" + "Standard_D2s_v5", + "Standard_D2s_v6" ], "default": "Standard_B2s", "title": "VM SKU", diff --git a/templates/shared_services/gitea/terraform/gitea-webapp.tf b/templates/shared_services/gitea/terraform/gitea-webapp.tf index f755033e2f..d22f969c77 100644 --- a/templates/shared_services/gitea/terraform/gitea-webapp.tf +++ b/templates/shared_services/gitea/terraform/gitea-webapp.tf @@ -46,9 +46,9 @@ resource "azurerm_linux_web_app" "gitea" { GITEA__database__SSL_MODE = "true" GITEA__database__DB_TYPE = "mysql" - GITEA__database__HOST = azurerm_mysql_server.gitea.fqdn + GITEA__database__HOST = azurerm_mysql_flexible_server.gitea.fqdn GITEA__database__NAME = azurerm_mysql_database.gitea.name - GITEA__database__USER = "${azurerm_mysql_server.gitea.administrator_login}@${azurerm_mysql_server.gitea.fqdn}" + GITEA__database__USER = "${azurerm_mysql_flexible_server.gitea.administrator_login}@${azurerm_mysql_flexible_server.gitea.fqdn}" GITEA__database__PASSWD = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.db_password.id})" } diff --git a/templates/shared_services/gitea/terraform/locals.tf b/templates/shared_services/gitea/terraform/locals.tf index d5cc148fcf..2fac81037e 100644 --- a/templates/shared_services/gitea/terraform/locals.tf +++ b/templates/shared_services/gitea/terraform/locals.tf @@ -6,6 +6,12 @@ locals { keyvault_name = "kv-${var.tre_id}" version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") gitea_allowed_fqdns_list = distinct(compact(split(",", replace(var.gitea_allowed_fqdns, " ", "")))) + gitea_sku = { + "GP | 5GB 2vCores" = { value = "GP_Gen5_2" }, + "GP | 5GB 4vCores" = { value = "GP_Gen5_4" }, + "GP | 5GB 6vCores" = { value = "GP_Gen5_6" }, + "GP | 5GB 8vCores" = { value = "GP_Gen5_8" } + } tre_shared_service_tags = { tre_id = var.tre_id tre_shared_service_id = var.tre_resource_id diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index 42bea9c4ff..867aa55fdd 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -6,31 +6,25 @@ resource "random_password" "password" { min_special = 2 } -resource "azurerm_mysql_server" "gitea" { - name = "mysql-${var.tre_id}" - resource_group_name = local.core_resource_group_name - location = data.azurerm_resource_group.rg.location - administrator_login = "mysqladmin" - administrator_login_password = random_password.password.result - sku_name = "GP_Gen5_2" - storage_mb = 5120 - version = "8.0" - auto_grow_enabled = true - backup_retention_days = 7 - geo_redundant_backup_enabled = false - infrastructure_encryption_enabled = false - public_network_access_enabled = false - ssl_enforcement_enabled = true - ssl_minimal_tls_version_enforced = "TLS1_2" - tags = local.tre_shared_service_tags +resource "azurerm_mysql_flexible_server" "gitea" { + name = "mysql-${var.tre_id}" + resource_group_name = local.core_resource_group_name + location = data.azurerm_resource_group.rg.location + administrator_login = "mysqladmin" + sku_name = local.gitea_sku[var.gitea_sku].value + version = "8.0" + backup_retention_days = 7 + geo_redundant_backup_enabled = false + public_network_access_enabled = false + tags = local.tre_shared_service_tags - lifecycle { ignore_changes = [tags, threat_detection_policy] } + lifecycle { ignore_changes = [tags] } } resource "azurerm_mysql_database" "gitea" { name = "gitea" resource_group_name = local.core_resource_group_name - server_name = azurerm_mysql_server.gitea.name + server_name = azurerm_mysql_flexible_server.gitea.name charset = "utf8" collation = "utf8_unicode_ci" } @@ -41,15 +35,15 @@ moved { } resource "azurerm_private_endpoint" "private_endpoint" { - name = "pe-${azurerm_mysql_server.gitea.name}" + name = "pe-${azurerm_mysql_flexible_server.gitea.name}" location = data.azurerm_resource_group.rg.location resource_group_name = local.core_resource_group_name subnet_id = data.azurerm_subnet.shared.id tags = local.tre_shared_service_tags private_service_connection { - private_connection_resource_id = azurerm_mysql_server.gitea.id - name = "psc-${azurerm_mysql_server.gitea.name}" + private_connection_resource_id = azurerm_mysql_flexible_server.gitea.id + name = "psc-${azurerm_mysql_flexible_server.gitea.name}" subresource_names = ["mysqlServer"] is_manual_connection = false } @@ -63,7 +57,7 @@ resource "azurerm_private_endpoint" "private_endpoint" { } resource "azurerm_key_vault_secret" "db_password" { - name = "${azurerm_mysql_server.gitea.name}-administrator-password" + name = "${azurerm_mysql_flexible_server.gitea.name}-administrator-password" value = random_password.password.result key_vault_id = data.azurerm_key_vault.keyvault.id tags = local.tre_shared_service_tags diff --git a/templates/shared_services/gitea/terraform/variables.tf b/templates/shared_services/gitea/terraform/variables.tf index a71d12ee5b..27a5ea133f 100644 --- a/templates/shared_services/gitea/terraform/variables.tf +++ b/templates/shared_services/gitea/terraform/variables.tf @@ -33,3 +33,7 @@ variable "acr_name" { variable "arm_environment" { type = string } + +variable "gitea_sku" { + type = string +} diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index a56ed459a3..2ea450d8b0 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.7 +version: 0.8.8 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/gitea/terraform/gitea-webapp.tf b/templates/workspace_services/gitea/terraform/gitea-webapp.tf index 92c0b68ac8..4b8a8c3a01 100644 --- a/templates/workspace_services/gitea/terraform/gitea-webapp.tf +++ b/templates/workspace_services/gitea/terraform/gitea-webapp.tf @@ -56,9 +56,9 @@ resource "azurerm_linux_web_app" "gitea" { GITEA__service__SHOW_REGISTRATION_BUTTON = false GITEA__database__SSL_MODE = "true" GITEA__database__DB_TYPE = "mysql" - GITEA__database__HOST = azurerm_mysql_server.gitea.fqdn + GITEA__database__HOST = azurerm_mysql_flexible_server.gitea.fqdn GITEA__database__NAME = azurerm_mysql_database.gitea.name - GITEA__database__USER = "${azurerm_mysql_server.gitea.administrator_login}@${azurerm_mysql_server.gitea.fqdn}" + GITEA__database__USER = "${azurerm_mysql_flexible_server.gitea.administrator_login}@${azurerm_mysql_flexible_server.gitea.fqdn}" GITEA__database__PASSWD = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.db_password.id})" } diff --git a/templates/workspace_services/gitea/terraform/locals.tf b/templates/workspace_services/gitea/terraform/locals.tf index 57122a09d3..132d9c3b45 100644 --- a/templates/workspace_services/gitea/terraform/locals.tf +++ b/templates/workspace_services/gitea/terraform/locals.tf @@ -8,6 +8,12 @@ locals { core_resource_group_name = "rg-${var.tre_id}" keyvault_name = lower("kv-${substr(local.workspace_resource_name_suffix, -20, -1)}") version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") + gitea_sku = { + "GP | 5GB 2vCores" = { value = "GP_Gen5_2" }, + "GP | 5GB 4vCores" = { value = "GP_Gen5_4" }, + "GP | 5GB 6vCores" = { value = "GP_Gen5_6" }, + "GP | 5GB 8vCores" = { value = "GP_Gen5_8" } + } workspace_service_tags = { tre_id = var.tre_id tre_workspace_id = var.workspace_id diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index ddd855edf4..a2213f15c5 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -6,23 +6,17 @@ resource "random_password" "password" { min_special = 2 } -resource "azurerm_mysql_server" "gitea" { - name = "mysql-${local.service_resource_name_suffix}" - resource_group_name = data.azurerm_resource_group.ws.name - location = data.azurerm_resource_group.ws.location - administrator_login = "mysqladmin" - administrator_login_password = random_password.password.result - sku_name = "GP_Gen5_2" - storage_mb = 5120 - version = "8.0" - auto_grow_enabled = true - backup_retention_days = 7 - geo_redundant_backup_enabled = false - infrastructure_encryption_enabled = false - public_network_access_enabled = false - ssl_enforcement_enabled = true - ssl_minimal_tls_version_enforced = "TLS1_2" - tags = local.workspace_service_tags +resource "azurerm_mysql_flexible_server" "gitea" { + name = "mysql-${local.service_resource_name_suffix}" + resource_group_name = data.azurerm_resource_group.ws.name + location = data.azurerm_resource_group.ws.location + administrator_login = "mysqladmin" + sku_name = local.gitea_sku[var.gitea_sku].value + version = "8.0" + backup_retention_days = 7 + geo_redundant_backup_enabled = false + public_network_access_enabled = false + tags = local.workspace_service_tags lifecycle { ignore_changes = [tags] } } @@ -30,7 +24,7 @@ resource "azurerm_mysql_server" "gitea" { resource "azurerm_mysql_database" "gitea" { name = "gitea" resource_group_name = data.azurerm_resource_group.ws.name - server_name = azurerm_mysql_server.gitea.name + server_name = azurerm_mysql_flexible_server.gitea.name charset = "utf8" collation = "utf8_unicode_ci" } @@ -41,15 +35,15 @@ moved { } resource "azurerm_private_endpoint" "private_endpoint" { - name = "pe-${azurerm_mysql_server.gitea.name}" + name = "pe-${azurerm_mysql_flexible_server.gitea.name}" location = data.azurerm_resource_group.ws.location resource_group_name = data.azurerm_resource_group.ws.name subnet_id = data.azurerm_subnet.services.id tags = local.workspace_service_tags private_service_connection { - private_connection_resource_id = azurerm_mysql_server.gitea.id - name = "psc-${azurerm_mysql_server.gitea.name}" + private_connection_resource_id = azurerm_mysql_flexible_server.gitea.id + name = "psc-${azurerm_mysql_flexible_server.gitea.name}" subresource_names = ["mysqlServer"] is_manual_connection = false } @@ -63,7 +57,7 @@ resource "azurerm_private_endpoint" "private_endpoint" { } resource "azurerm_key_vault_secret" "db_password" { - name = "${azurerm_mysql_server.gitea.name}-administrator-password" + name = "${azurerm_mysql_flexible_server.gitea.name}-administrator-password" value = random_password.password.result key_vault_id = data.azurerm_key_vault.ws.id tags = local.workspace_service_tags diff --git a/templates/workspace_services/gitea/terraform/variables.tf b/templates/workspace_services/gitea/terraform/variables.tf index 105bb3e014..f976084aa6 100644 --- a/templates/workspace_services/gitea/terraform/variables.tf +++ b/templates/workspace_services/gitea/terraform/variables.tf @@ -24,3 +24,6 @@ variable "gitea_storage_limit" { variable "arm_environment" { type = string } +variable "gitea_sku" { + type = string +} diff --git a/templates/workspace_services/gitea/version.txt b/templates/workspace_services/gitea/version.txt index 906d362f7d..43c4ab0058 100644 --- a/templates/workspace_services/gitea/version.txt +++ b/templates/workspace_services/gitea/version.txt @@ -1 +1 @@ -__version__ = "0.6.0" +__version__ = "0.6.1" diff --git a/templates/workspace_services/mysql/terraform/mysql.tf b/templates/workspace_services/mysql/terraform/mysql.tf index 9c0f387392..cca9e1cb9a 100644 --- a/templates/workspace_services/mysql/terraform/mysql.tf +++ b/templates/workspace_services/mysql/terraform/mysql.tf @@ -6,23 +6,17 @@ resource "random_password" "password" { min_special = 2 } -resource "azurerm_mysql_server" "mysql" { - name = "mysql-${local.service_resource_name_suffix}" - resource_group_name = data.azurerm_resource_group.ws.name - location = data.azurerm_resource_group.ws.location - administrator_login = "mysqladmin" - administrator_login_password = random_password.password.result - sku_name = local.sql_sku[var.sql_sku].value - storage_mb = var.storage_mb - version = "8.0" - auto_grow_enabled = true - backup_retention_days = 7 - geo_redundant_backup_enabled = false - infrastructure_encryption_enabled = false - public_network_access_enabled = false - ssl_enforcement_enabled = true - ssl_minimal_tls_version_enforced = "TLS1_2" - tags = local.workspace_service_tags +resource "azurerm_mysql_flexible_server" "mysql" { + name = "mysql-${local.service_resource_name_suffix}" + resource_group_name = data.azurerm_resource_group.ws.name + location = data.azurerm_resource_group.ws.location + administrator_login = "mysqladmin" + sku_name = local.sql_sku[var.sql_sku].value + version = "8.0" + backup_retention_days = 7 + geo_redundant_backup_enabled = false + public_network_access_enabled = false + tags = local.workspace_service_tags lifecycle { ignore_changes = [tags] } } @@ -30,21 +24,21 @@ resource "azurerm_mysql_server" "mysql" { resource "azurerm_mysql_database" "db" { name = var.db_name resource_group_name = data.azurerm_resource_group.ws.name - server_name = azurerm_mysql_server.mysql.name + server_name = azurerm_mysql_flexible_server.mysql.name charset = "utf8" collation = "utf8_unicode_ci" } resource "azurerm_private_endpoint" "mysql_private_endpoint" { - name = "pe-${azurerm_mysql_server.mysql.name}" + name = "pe-${azurerm_mysql_flexible_server.mysql.name}" location = data.azurerm_resource_group.ws.location resource_group_name = data.azurerm_resource_group.ws.name subnet_id = data.azurerm_subnet.services.id tags = local.workspace_service_tags private_service_connection { - private_connection_resource_id = azurerm_mysql_server.mysql.id - name = "psc-${azurerm_mysql_server.mysql.name}" + private_connection_resource_id = azurerm_mysql_flexible_server.mysql.id + name = "psc-${azurerm_mysql_flexible_server.mysql.name}" subresource_names = ["mysqlServer"] is_manual_connection = false } @@ -58,7 +52,7 @@ resource "azurerm_private_endpoint" "mysql_private_endpoint" { } resource "azurerm_key_vault_secret" "db_password" { - name = "${azurerm_mysql_server.mysql.name}-administrator-password" + name = "${azurerm_mysql_flexible_server.mysql.name}-administrator-password" value = random_password.password.result key_vault_id = data.azurerm_key_vault.ws.id tags = local.workspace_service_tags diff --git a/templates/workspace_services/mysql/terraform/outputs.tf b/templates/workspace_services/mysql/terraform/outputs.tf index 824c5705ab..4b6aaa7fe0 100644 --- a/templates/workspace_services/mysql/terraform/outputs.tf +++ b/templates/workspace_services/mysql/terraform/outputs.tf @@ -1,3 +1,3 @@ output "mysql_fqdn" { - value = azurerm_mysql_server.mysql.fqdn + value = azurerm_mysql_flexible_server.mysql.fqdn } From 2705dfbe22c89cb7b925ef8df621febe0192a94e Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 19 Mar 2024 12:28:37 +0000 Subject: [PATCH 02/28] removing public_network_access_enabled = false --- .../shared_services/gitea/terraform/mysql.tf | 19 +++++++++---------- .../gitea/terraform/mysql.tf | 19 +++++++++---------- .../mysql/terraform/mysql.tf | 19 +++++++++---------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index 867aa55fdd..2881fbfc90 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -7,16 +7,15 @@ resource "random_password" "password" { } resource "azurerm_mysql_flexible_server" "gitea" { - name = "mysql-${var.tre_id}" - resource_group_name = local.core_resource_group_name - location = data.azurerm_resource_group.rg.location - administrator_login = "mysqladmin" - sku_name = local.gitea_sku[var.gitea_sku].value - version = "8.0" - backup_retention_days = 7 - geo_redundant_backup_enabled = false - public_network_access_enabled = false - tags = local.tre_shared_service_tags + name = "mysql-${var.tre_id}" + resource_group_name = local.core_resource_group_name + location = data.azurerm_resource_group.rg.location + administrator_login = "mysqladmin" + sku_name = local.gitea_sku[var.gitea_sku].value + version = "8.0.21" + backup_retention_days = 7 + geo_redundant_backup_enabled = false + tags = local.tre_shared_service_tags lifecycle { ignore_changes = [tags] } } diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index a2213f15c5..f05dbe9e0c 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -7,16 +7,15 @@ resource "random_password" "password" { } resource "azurerm_mysql_flexible_server" "gitea" { - name = "mysql-${local.service_resource_name_suffix}" - resource_group_name = data.azurerm_resource_group.ws.name - location = data.azurerm_resource_group.ws.location - administrator_login = "mysqladmin" - sku_name = local.gitea_sku[var.gitea_sku].value - version = "8.0" - backup_retention_days = 7 - geo_redundant_backup_enabled = false - public_network_access_enabled = false - tags = local.workspace_service_tags + name = "mysql-${local.service_resource_name_suffix}" + resource_group_name = data.azurerm_resource_group.ws.name + location = data.azurerm_resource_group.ws.location + administrator_login = "mysqladmin" + sku_name = local.gitea_sku[var.gitea_sku].value + version = "8.0.21" + backup_retention_days = 7 + geo_redundant_backup_enabled = false + tags = local.workspace_service_tags lifecycle { ignore_changes = [tags] } } diff --git a/templates/workspace_services/mysql/terraform/mysql.tf b/templates/workspace_services/mysql/terraform/mysql.tf index cca9e1cb9a..9ae1232ce1 100644 --- a/templates/workspace_services/mysql/terraform/mysql.tf +++ b/templates/workspace_services/mysql/terraform/mysql.tf @@ -7,16 +7,15 @@ resource "random_password" "password" { } resource "azurerm_mysql_flexible_server" "mysql" { - name = "mysql-${local.service_resource_name_suffix}" - resource_group_name = data.azurerm_resource_group.ws.name - location = data.azurerm_resource_group.ws.location - administrator_login = "mysqladmin" - sku_name = local.sql_sku[var.sql_sku].value - version = "8.0" - backup_retention_days = 7 - geo_redundant_backup_enabled = false - public_network_access_enabled = false - tags = local.workspace_service_tags + name = "mysql-${local.service_resource_name_suffix}" + resource_group_name = data.azurerm_resource_group.ws.name + location = data.azurerm_resource_group.ws.location + administrator_login = "mysqladmin" + sku_name = local.sql_sku[var.sql_sku].value + version = "8.0.21" + backup_retention_days = 7 + geo_redundant_backup_enabled = false + tags = local.workspace_service_tags lifecycle { ignore_changes = [tags] } } From 21e982328229cf0c3d2a56042f70ee3734fdbc5e Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 19 Mar 2024 13:35:47 +0000 Subject: [PATCH 03/28] removing extra line --- templates/shared_services/admin-vm/template_schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/shared_services/admin-vm/template_schema.json b/templates/shared_services/admin-vm/template_schema.json index 129ca5f1c1..d644d49be7 100644 --- a/templates/shared_services/admin-vm/template_schema.json +++ b/templates/shared_services/admin-vm/template_schema.json @@ -13,8 +13,7 @@ "Standard_B2s", "Standard_D2s_v3", "Standard_D2s_v4", - "Standard_D2s_v5", - "Standard_D2s_v6" + "Standard_D2s_v5" ], "default": "Standard_B2s", "title": "VM SKU", From 5ea5875b95ea96ebc997919d72f570a6c9273392 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 19 Mar 2024 14:46:41 +0000 Subject: [PATCH 04/28] worked on db sizes and naming --- templates/shared_services/admin-vm/template_schema.json | 5 ++--- templates/shared_services/gitea/parameters.json | 6 ++++++ templates/shared_services/gitea/porter.yaml | 2 +- templates/shared_services/gitea/terraform/locals.tf | 7 +++---- templates/workspace_services/gitea/parameters.json | 6 ++++++ templates/workspace_services/gitea/porter.yaml | 2 +- templates/workspace_services/gitea/terraform/locals.tf | 7 +++---- templates/workspace_services/mysql/porter.yaml | 2 +- templates/workspace_services/mysql/template_schema.json | 7 +++---- templates/workspace_services/mysql/terraform/locals.tf | 7 +++---- 10 files changed, 29 insertions(+), 22 deletions(-) diff --git a/templates/shared_services/admin-vm/template_schema.json b/templates/shared_services/admin-vm/template_schema.json index d644d49be7..c6060555ae 100644 --- a/templates/shared_services/admin-vm/template_schema.json +++ b/templates/shared_services/admin-vm/template_schema.json @@ -11,9 +11,8 @@ "type": "string", "enum": [ "Standard_B2s", - "Standard_D2s_v3", - "Standard_D2s_v4", - "Standard_D2s_v5" + "Standard_D2ads_v5", + "Standard_E2ds_v4" ], "default": "Standard_B2s", "title": "VM SKU", diff --git a/templates/shared_services/gitea/parameters.json b/templates/shared_services/gitea/parameters.json index 71aebc5306..f9ba6dc560 100755 --- a/templates/shared_services/gitea/parameters.json +++ b/templates/shared_services/gitea/parameters.json @@ -45,6 +45,12 @@ "source": { "env": "ARM_ENVIRONMENT" } + }, + { + "name": "gitea_sku", + "source": { + "env": "GITEA_SKU" + } } ] } diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 0133a6d015..0bc035cad5 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 0.6.10 +version: 0.6.11 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/gitea/terraform/locals.tf b/templates/shared_services/gitea/terraform/locals.tf index 2fac81037e..4d4dd37353 100644 --- a/templates/shared_services/gitea/terraform/locals.tf +++ b/templates/shared_services/gitea/terraform/locals.tf @@ -7,10 +7,9 @@ locals { version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") gitea_allowed_fqdns_list = distinct(compact(split(",", replace(var.gitea_allowed_fqdns, " ", "")))) gitea_sku = { - "GP | 5GB 2vCores" = { value = "GP_Gen5_2" }, - "GP | 5GB 4vCores" = { value = "GP_Gen5_4" }, - "GP | 5GB 6vCores" = { value = "GP_Gen5_6" }, - "GP | 5GB 8vCores" = { value = "GP_Gen5_8" } + "B | 4GB 2vCores" = { value = "Standard_B2s" }, + "GP | 8GB 2vCores" = { value = "Standard_D2ads_v5" }, + "BC | 16GB 2vCores" = { value = "Standard_E2ds_v4" } } tre_shared_service_tags = { tre_id = var.tre_id diff --git a/templates/workspace_services/gitea/parameters.json b/templates/workspace_services/gitea/parameters.json index 446a3685f4..840216ba5f 100755 --- a/templates/workspace_services/gitea/parameters.json +++ b/templates/workspace_services/gitea/parameters.json @@ -63,6 +63,12 @@ "source": { "env": "ARM_ENVIRONMENT" } + }, + { + "name": "gitea_sku", + "source": { + "env": "GITEA_SKU" + } } ] } diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index 2ea450d8b0..3fab177819 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.8 +version: 0.8.9 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/gitea/terraform/locals.tf b/templates/workspace_services/gitea/terraform/locals.tf index 132d9c3b45..7879a5b385 100644 --- a/templates/workspace_services/gitea/terraform/locals.tf +++ b/templates/workspace_services/gitea/terraform/locals.tf @@ -9,10 +9,9 @@ locals { keyvault_name = lower("kv-${substr(local.workspace_resource_name_suffix, -20, -1)}") version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") gitea_sku = { - "GP | 5GB 2vCores" = { value = "GP_Gen5_2" }, - "GP | 5GB 4vCores" = { value = "GP_Gen5_4" }, - "GP | 5GB 6vCores" = { value = "GP_Gen5_6" }, - "GP | 5GB 8vCores" = { value = "GP_Gen5_8" } + "B | 4GB 2vCores" = { value = "Standard_B2s" }, + "GP | 8GB 2vCores" = { value = "Standard_D2ads_v5" }, + "BC | 16GB 2vCores" = { value = "Standard_E2ds_v4" } } workspace_service_tags = { tre_id = var.tre_id diff --git a/templates/workspace_services/mysql/porter.yaml b/templates/workspace_services/mysql/porter.yaml index fd665488b8..9df674bae3 100644 --- a/templates/workspace_services/mysql/porter.yaml +++ b/templates/workspace_services/mysql/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-mysql -version: 0.4.5 +version: 0.4.6 description: "A MySQL workspace service" registry: azuretre dockerfile: Dockerfile.tmpl diff --git a/templates/workspace_services/mysql/template_schema.json b/templates/workspace_services/mysql/template_schema.json index 5513e5f115..4410c01d71 100644 --- a/templates/workspace_services/mysql/template_schema.json +++ b/templates/workspace_services/mysql/template_schema.json @@ -12,10 +12,9 @@ "title": "MySQL server SKU", "description": "MySQL server SKU", "enum": [ - "GP | 5GB 2vCores", - "GP | 5GB 4vCores", - "GP | 5GB 6vCores", - "GP | 5GB 8vCores" + "B | 4GB 2vCores", + "GP | 8GB 2vCores", + "BC | 16GB 2vCores" ], "default": "GP | 5GB 2vCores" }, diff --git a/templates/workspace_services/mysql/terraform/locals.tf b/templates/workspace_services/mysql/terraform/locals.tf index d666bfa202..d1d6a926bd 100644 --- a/templates/workspace_services/mysql/terraform/locals.tf +++ b/templates/workspace_services/mysql/terraform/locals.tf @@ -6,10 +6,9 @@ locals { keyvault_name = lower("kv-${substr(local.workspace_resource_name_suffix, -20, -1)}") core_resource_group_name = "rg-${var.tre_id}" sql_sku = { - "GP | 5GB 2vCores" = { value = "GP_Gen5_2" }, - "GP | 5GB 4vCores" = { value = "GP_Gen5_4" }, - "GP | 5GB 6vCores" = { value = "GP_Gen5_6" }, - "GP | 5GB 8vCores" = { value = "GP_Gen5_8" } + "B | 4GB 2vCores" = { value = "Standard_B2s" }, + "GP | 8GB 2vCores" = { value = "Standard_D2ads_v5" }, + "BC | 16GB 2vCores" = { value = "Standard_E2ds_v4" } } workspace_service_tags = { tre_id = var.tre_id From 63cd8bf4ee3f0f970393446e7762bbd6e1da5b4c Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 19 Mar 2024 15:01:14 +0000 Subject: [PATCH 05/28] gitea_sku updates --- templates/shared_services/gitea/porter.yaml | 5 +++++ templates/workspace_services/gitea/porter.yaml | 5 +++++ templates/workspace_services/mysql/porter.yaml | 2 +- templates/workspace_services/mysql/template_schema.json | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 0bc035cad5..7ca1838170 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -51,6 +51,9 @@ parameters: env: ARM_ENVIRONMENT type: string default: "public" + - name: gitea_sku + type: string + default: "B | 4GB 2vCores" mixins: - terraform: @@ -89,6 +92,7 @@ install: mgmt_resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } acr_name: ${ bundle.parameters.mgmt_acr_name } arm_environment: ${ bundle.parameters.arm_environment } + gitea_sku: ${ bundle.parameters.gitea_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } @@ -129,6 +133,7 @@ uninstall: mgmt_resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } acr_name: ${ bundle.parameters.mgmt_acr_name } arm_environment: ${ bundle.parameters.arm_environment } + gitea_sku: ${ bundle.parameters.gitea_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index 3fab177819..88e376b8d1 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -60,6 +60,9 @@ parameters: env: ARM_ENVIRONMENT type: string default: "public" + - name: gitea_sku + type: string + default: "B | 4GB 2vCores" - name: aad_authority_url type: string default: "https://login.microsoftonline.com" @@ -102,6 +105,7 @@ install: mgmt_resource_group_name: ${ bundle.parameters.mgmt_resource_group_name } aad_authority_url: ${ bundle.parameters.aad_authority_url } arm_environment: ${ bundle.parameters.arm_environment } + gitea_sku: ${ bundle.parameters.gitea_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } @@ -146,6 +150,7 @@ uninstall: mgmt_resource_group_name: ${ bundle.parameters.mgmt_resource_group_name } aad_authority_url: ${ bundle.parameters.aad_authority_url } arm_environment: ${ bundle.parameters.arm_environment } + gitea_sku: ${ bundle.parameters.gitea_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } diff --git a/templates/workspace_services/mysql/porter.yaml b/templates/workspace_services/mysql/porter.yaml index 9df674bae3..1f020a5470 100644 --- a/templates/workspace_services/mysql/porter.yaml +++ b/templates/workspace_services/mysql/porter.yaml @@ -47,7 +47,7 @@ parameters: default: "public" - name: sql_sku type: string - default: "GP | 5GB 2vCores" + default: "B | 4GB 2vCores" - name: storage_mb type: integer default: 5120 diff --git a/templates/workspace_services/mysql/template_schema.json b/templates/workspace_services/mysql/template_schema.json index 4410c01d71..5182879012 100644 --- a/templates/workspace_services/mysql/template_schema.json +++ b/templates/workspace_services/mysql/template_schema.json @@ -16,7 +16,7 @@ "GP | 8GB 2vCores", "BC | 16GB 2vCores" ], - "default": "GP | 5GB 2vCores" + "default": "B | 4GB 2vCores" }, "storage_mb": { "$id": "#/properties/storage_mb", From c48bba3b29d0de3e6a33f50f4b6a670b2ba8a6f2 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Mon, 25 Mar 2024 09:21:06 +0000 Subject: [PATCH 06/28] Update version in porter.yaml and revert options in template_schema --- templates/shared_services/admin-vm/template_schema.json | 5 +++-- templates/shared_services/gitea/porter.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/shared_services/admin-vm/template_schema.json b/templates/shared_services/admin-vm/template_schema.json index c6060555ae..d644d49be7 100644 --- a/templates/shared_services/admin-vm/template_schema.json +++ b/templates/shared_services/admin-vm/template_schema.json @@ -11,8 +11,9 @@ "type": "string", "enum": [ "Standard_B2s", - "Standard_D2ads_v5", - "Standard_E2ds_v4" + "Standard_D2s_v3", + "Standard_D2s_v4", + "Standard_D2s_v5" ], "default": "Standard_B2s", "title": "VM SKU", diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 7ca1838170..687d275722 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 0.6.11 +version: 1.0.0 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre From 7b7b0c141273ad77b8a9dec7edd1eda503186943 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 26 Mar 2024 10:55:46 +0000 Subject: [PATCH 07/28] tweak --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4bcb9bcc3e..ed842400b3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ **Azure TRE documentation site**: ## Background + Across the health industry, be it a pharmaceutical company interrogating clinical trial results, or a public health provider analyzing electronic health records, there is the need to enable researchers, analysts, and developers to work with sensitive data sets. @@ -18,6 +19,7 @@ This project is typically implemented alongside a data platform that provides re TREs are not “one size fits all”, hence although the Azure TRE has a number of out of the box features, the project has been built be extensible, and hence tooling and data platform agnostic. Core features include: + - Self-service workspace management for TRE administrators - Self-service provisioning of research tooling for research teams - Package and repository mirroring - PyPi, R-CRAN, Apt and more. @@ -25,7 +27,7 @@ Core features include: - Azure Active Directory integration - Airlock - import and export - Cost reporting -- Ready to workspace templates including: +- Ready to workspace templates including: - Restricted with data exfiltration control - Unrestricted for open data - Ready to go workspace service templates including: @@ -36,7 +38,7 @@ Core features include: ## Project Status and Support -***This project's code base is still under development and breaking changes will happen. Whilst the maintainers will do our best to minimise disruption to existing deployments, this may not always be possible. Stable releases will be published when the project is more mature.*** +**_This project's code base is still under development and breaking changes will happen. Whilst the maintainers will do our best to minimise disruption to existing deployments, this may not always be possible. Stable releases will be published when the project is more mature._** The aim is to bring together learnings from past customer engagements where TREs have been built into a single reference solution. This is a solution accelerator aiming to be a great starting point for a customized TRE solution. You're encouraged to download and customize the solution to meet your requirements @@ -46,7 +48,7 @@ It is important before deployment of the solution that the [Support Policy](SUPP ## Contributing -This project welcomes contributions and suggestions. Most contributions require you to agree to a +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com). @@ -66,7 +68,6 @@ This project may contain trademarks or logos for projects, products, or services Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. - ## Repository structure ```text From 74c4c68e1bc686e2ac3b28b8c28d3e71e8ff04be Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 26 Mar 2024 10:57:32 +0000 Subject: [PATCH 08/28] tweak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed842400b3..2b80d869b7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Azure Trusted Research Environment -**Azure TRE documentation site**: +**Azure TRE documentation site\***: ## Background From e7d642e3d9fc277cd808ee86ead43da17daf1546 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Tue, 26 Mar 2024 10:59:17 +0000 Subject: [PATCH 09/28] tweak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b80d869b7..ed842400b3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Azure Trusted Research Environment -**Azure TRE documentation site\***: +**Azure TRE documentation site**: ## Background From 2320ecc7516084d0906b699c4b74027b0b8d993f Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Wed, 27 Mar 2024 09:29:48 +0000 Subject: [PATCH 10/28] tweak --- .markdownlint.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.markdownlint.json b/.markdownlint.json index 3ffa116956..e9f48d27ac 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -4,7 +4,7 @@ "indent": 2 }, "MD013": { - "line_length": 400 + "line_length": 401 }, "MD026": { "punctuation": ".,;:!。,;:" @@ -13,4 +13,4 @@ "MD033": false, "MD036": false, "blank_lines": false -} +} \ No newline at end of file From ed20058668756fc84342c35319d5dbee7b71b03f Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Wed, 27 Mar 2024 09:33:02 +0000 Subject: [PATCH 11/28] tweak --- .markdownlint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.markdownlint.json b/.markdownlint.json index e9f48d27ac..e515e6f847 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -4,7 +4,7 @@ "indent": 2 }, "MD013": { - "line_length": 401 + "line_length": 400 }, "MD026": { "punctuation": ".,;:!。,;:" From 8fe030e749e56e87f23ac313228e36d8adcbaa3b Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Wed, 27 Mar 2024 09:34:40 +0000 Subject: [PATCH 12/28] tweak --- .markdownlint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.markdownlint.json b/.markdownlint.json index e515e6f847..e9f48d27ac 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -4,7 +4,7 @@ "indent": 2 }, "MD013": { - "line_length": 400 + "line_length": 401 }, "MD026": { "punctuation": ".,;:!。,;:" From b97c1789f72c6a7f173bc05fabffa62f5f387b8e Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Wed, 27 Mar 2024 09:35:27 +0000 Subject: [PATCH 13/28] tweak --- .markdownlint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.markdownlint.json b/.markdownlint.json index e9f48d27ac..e515e6f847 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -4,7 +4,7 @@ "indent": 2 }, "MD013": { - "line_length": 401 + "line_length": 400 }, "MD026": { "punctuation": ".,;:!。,;:" From 2b68dc44a2e6ab83a146d4a4a534dcf22a4b4a16 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Thu, 28 Mar 2024 12:24:26 +0000 Subject: [PATCH 14/28] Update SQL SKU variables --- templates/shared_services/gitea/parameters.json | 4 ++-- templates/shared_services/gitea/porter.yaml | 7 ++++--- .../shared_services/gitea/template_schema.json | 14 +++++++++++++- .../shared_services/gitea/terraform/locals.tf | 8 ++++---- templates/shared_services/gitea/terraform/mysql.tf | 3 ++- .../shared_services/gitea/terraform/variables.tf | 2 +- templates/workspace_services/gitea/parameters.json | 6 +++--- templates/workspace_services/gitea/porter.yaml | 6 +++--- .../workspace_services/gitea/terraform/locals.tf | 8 ++++---- .../workspace_services/gitea/terraform/mysql.tf | 3 ++- .../gitea/terraform/variables.tf | 2 +- .../workspace_services/mysql/terraform/locals.tf | 6 +++--- 12 files changed, 42 insertions(+), 27 deletions(-) diff --git a/templates/shared_services/gitea/parameters.json b/templates/shared_services/gitea/parameters.json index f9ba6dc560..22a4df7f1d 100755 --- a/templates/shared_services/gitea/parameters.json +++ b/templates/shared_services/gitea/parameters.json @@ -47,9 +47,9 @@ } }, { - "name": "gitea_sku", + "name": "sql_sku", "source": { - "env": "GITEA_SKU" + "env": "SQL_SKU" } } ] diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 687d275722..73bfa78a46 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -51,7 +51,7 @@ parameters: env: ARM_ENVIRONMENT type: string default: "public" - - name: gitea_sku + - name: sql_sku type: string default: "B | 4GB 2vCores" @@ -92,7 +92,7 @@ install: mgmt_resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } acr_name: ${ bundle.parameters.mgmt_acr_name } arm_environment: ${ bundle.parameters.arm_environment } - gitea_sku: ${ bundle.parameters.gitea_sku } + sql_sku: ${ bundle.parameters.sql_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } @@ -113,6 +113,7 @@ upgrade: mgmt_resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } acr_name: ${ bundle.parameters.mgmt_acr_name } arm_environment: ${ bundle.parameters.arm_environment } + sql_sku: ${ bundle.parameters.sql_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } @@ -133,7 +134,7 @@ uninstall: mgmt_resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } acr_name: ${ bundle.parameters.mgmt_acr_name } arm_environment: ${ bundle.parameters.arm_environment } - gitea_sku: ${ bundle.parameters.gitea_sku } + sql_sku: ${ bundle.parameters.sql_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } diff --git a/templates/shared_services/gitea/template_schema.json b/templates/shared_services/gitea/template_schema.json index 145f8fe57e..442594b9e5 100644 --- a/templates/shared_services/gitea/template_schema.json +++ b/templates/shared_services/gitea/template_schema.json @@ -27,6 +27,18 @@ "default": "The Gitea shared service is used for mirroring external Git repositories. For instructions on how to create Git mirrors see [https://docs.gitea.com/usage/repo-mirror](https://docs.gitea.com/usage/repo-mirror).", "updateable": true }, + "sql_sku": { + "$id": "#/properties/sql_sku", + "type": "string", + "title": "MySQL server SKU", + "description": "MySQL server SKU", + "enum": [ + "B | 4GB 2vCores", + "GP | 8GB 2vCores", + "BC | 16GB 2vCores" + ], + "default": "B | 4GB 2vCores" + }, "is_exposed_externally": { "$id": "#/properties/is_exposed_externally", "type": "boolean", @@ -149,4 +161,4 @@ } ] } -} +} \ No newline at end of file diff --git a/templates/shared_services/gitea/terraform/locals.tf b/templates/shared_services/gitea/terraform/locals.tf index 4d4dd37353..8668ed35a3 100644 --- a/templates/shared_services/gitea/terraform/locals.tf +++ b/templates/shared_services/gitea/terraform/locals.tf @@ -6,10 +6,10 @@ locals { keyvault_name = "kv-${var.tre_id}" version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") gitea_allowed_fqdns_list = distinct(compact(split(",", replace(var.gitea_allowed_fqdns, " ", "")))) - gitea_sku = { - "B | 4GB 2vCores" = { value = "Standard_B2s" }, - "GP | 8GB 2vCores" = { value = "Standard_D2ads_v5" }, - "BC | 16GB 2vCores" = { value = "Standard_E2ds_v4" } + sql_sku = { + "B | 4GB 2vCores" = { value = "B_Standard_B2s" }, + "GP | 8GB 2vCores" = { value = "GP_Standard_D2ads_v5" }, + "BC | 16GB 2vCores" = { value = "MO_Standard_E2ds_v4" } } tre_shared_service_tags = { tre_id = var.tre_id diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index 2881fbfc90..027640184d 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -11,7 +11,8 @@ resource "azurerm_mysql_flexible_server" "gitea" { resource_group_name = local.core_resource_group_name location = data.azurerm_resource_group.rg.location administrator_login = "mysqladmin" - sku_name = local.gitea_sku[var.gitea_sku].value + administrator_login_password = random_password.password.result + sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 geo_redundant_backup_enabled = false diff --git a/templates/shared_services/gitea/terraform/variables.tf b/templates/shared_services/gitea/terraform/variables.tf index 27a5ea133f..d0bf6da91d 100644 --- a/templates/shared_services/gitea/terraform/variables.tf +++ b/templates/shared_services/gitea/terraform/variables.tf @@ -34,6 +34,6 @@ variable "arm_environment" { type = string } -variable "gitea_sku" { +variable "sql_sku" { type = string } diff --git a/templates/workspace_services/gitea/parameters.json b/templates/workspace_services/gitea/parameters.json index 840216ba5f..1b2be1a537 100755 --- a/templates/workspace_services/gitea/parameters.json +++ b/templates/workspace_services/gitea/parameters.json @@ -65,10 +65,10 @@ } }, { - "name": "gitea_sku", + "name": "sql_sku", "source": { - "env": "GITEA_SKU" + "env": "SQL_SKU" } } ] -} +} \ No newline at end of file diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index 88e376b8d1..9cb7bdbdeb 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -60,7 +60,7 @@ parameters: env: ARM_ENVIRONMENT type: string default: "public" - - name: gitea_sku + - name: sql_sku type: string default: "B | 4GB 2vCores" - name: aad_authority_url @@ -105,7 +105,7 @@ install: mgmt_resource_group_name: ${ bundle.parameters.mgmt_resource_group_name } aad_authority_url: ${ bundle.parameters.aad_authority_url } arm_environment: ${ bundle.parameters.arm_environment } - gitea_sku: ${ bundle.parameters.gitea_sku } + sql_sku: ${ bundle.parameters.sql_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } @@ -150,7 +150,7 @@ uninstall: mgmt_resource_group_name: ${ bundle.parameters.mgmt_resource_group_name } aad_authority_url: ${ bundle.parameters.aad_authority_url } arm_environment: ${ bundle.parameters.arm_environment } - gitea_sku: ${ bundle.parameters.gitea_sku } + sql_sku: ${ bundle.parameters.sql_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } diff --git a/templates/workspace_services/gitea/terraform/locals.tf b/templates/workspace_services/gitea/terraform/locals.tf index 7879a5b385..35a5ca7370 100644 --- a/templates/workspace_services/gitea/terraform/locals.tf +++ b/templates/workspace_services/gitea/terraform/locals.tf @@ -8,10 +8,10 @@ locals { core_resource_group_name = "rg-${var.tre_id}" keyvault_name = lower("kv-${substr(local.workspace_resource_name_suffix, -20, -1)}") version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") - gitea_sku = { - "B | 4GB 2vCores" = { value = "Standard_B2s" }, - "GP | 8GB 2vCores" = { value = "Standard_D2ads_v5" }, - "BC | 16GB 2vCores" = { value = "Standard_E2ds_v4" } + sql_sku = { + "B | 4GB 2vCores" = { value = "B_Standard_B2s" }, + "GP | 8GB 2vCores" = { value = "GP_Standard_D2ads_v5" }, + "BC | 16GB 2vCores" = { value = "MO_Standard_E2ds_v4" } } workspace_service_tags = { tre_id = var.tre_id diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index f05dbe9e0c..e56f0dbe1e 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -11,7 +11,8 @@ resource "azurerm_mysql_flexible_server" "gitea" { resource_group_name = data.azurerm_resource_group.ws.name location = data.azurerm_resource_group.ws.location administrator_login = "mysqladmin" - sku_name = local.gitea_sku[var.gitea_sku].value + administrator_login_password = random_password.password.result + sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 geo_redundant_backup_enabled = false diff --git a/templates/workspace_services/gitea/terraform/variables.tf b/templates/workspace_services/gitea/terraform/variables.tf index f976084aa6..181a27045e 100644 --- a/templates/workspace_services/gitea/terraform/variables.tf +++ b/templates/workspace_services/gitea/terraform/variables.tf @@ -24,6 +24,6 @@ variable "gitea_storage_limit" { variable "arm_environment" { type = string } -variable "gitea_sku" { +variable "sql_sku" { type = string } diff --git a/templates/workspace_services/mysql/terraform/locals.tf b/templates/workspace_services/mysql/terraform/locals.tf index d1d6a926bd..ca3a236e47 100644 --- a/templates/workspace_services/mysql/terraform/locals.tf +++ b/templates/workspace_services/mysql/terraform/locals.tf @@ -6,9 +6,9 @@ locals { keyvault_name = lower("kv-${substr(local.workspace_resource_name_suffix, -20, -1)}") core_resource_group_name = "rg-${var.tre_id}" sql_sku = { - "B | 4GB 2vCores" = { value = "Standard_B2s" }, - "GP | 8GB 2vCores" = { value = "Standard_D2ads_v5" }, - "BC | 16GB 2vCores" = { value = "Standard_E2ds_v4" } + "B | 4GB 2vCores" = { value = "B_Standard_B2s" }, + "GP | 8GB 2vCores" = { value = "GP_Standard_D2ads_v5" }, + "BC | 16GB 2vCores" = { value = "MO_Standard_E2ds_v4" } } workspace_service_tags = { tre_id = var.tre_id From cc1aa2720315a71bce9746f2fff59f21ce214735 Mon Sep 17 00:00:00 2001 From: nasaldrops Date: Thu, 28 Mar 2024 12:55:00 +0000 Subject: [PATCH 15/28] Remove administrator login password from MySQL configuration --- templates/shared_services/gitea/terraform/mysql.tf | 1 - templates/workspace_services/gitea/terraform/mysql.tf | 1 - 2 files changed, 2 deletions(-) diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index 027640184d..f00c2388bc 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -11,7 +11,6 @@ resource "azurerm_mysql_flexible_server" "gitea" { resource_group_name = local.core_resource_group_name location = data.azurerm_resource_group.rg.location administrator_login = "mysqladmin" - administrator_login_password = random_password.password.result sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index e56f0dbe1e..502a6f1958 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -11,7 +11,6 @@ resource "azurerm_mysql_flexible_server" "gitea" { resource_group_name = data.azurerm_resource_group.ws.name location = data.azurerm_resource_group.ws.location administrator_login = "mysqladmin" - administrator_login_password = random_password.password.result sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 From 480adc3fd8a80d15877cec36fe78084f2dc86574 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 09:45:45 +0000 Subject: [PATCH 16/28] update password --- templates/shared_services/gitea/terraform/mysql.tf | 1 + templates/workspace_services/gitea/terraform/mysql.tf | 1 + 2 files changed, 2 insertions(+) diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index f00c2388bc..eef86e3e5b 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -11,6 +11,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { resource_group_name = local.core_resource_group_name location = data.azurerm_resource_group.rg.location administrator_login = "mysqladmin" + administrator_password = random_password.password.result sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index 502a6f1958..3b258d173d 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -11,6 +11,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { resource_group_name = data.azurerm_resource_group.ws.name location = data.azurerm_resource_group.ws.location administrator_login = "mysqladmin" + administrator_password = random_password.password.result sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 From 44395db7b1645129e5d13c325916271ebc1afcf4 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 10:30:07 +0000 Subject: [PATCH 17/28] add in sql_sku to template --- templates/workspace_services/gitea/porter.yaml | 3 ++- .../workspace_services/gitea/template_schema.json | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index 9cb7bdbdeb..3e386e74c0 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.9 +version: 0.8.10 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre @@ -128,6 +128,7 @@ upgrade: mgmt_resource_group_name: ${ bundle.parameters.mgmt_resource_group_name } aad_authority_url: ${ bundle.parameters.aad_authority_url } arm_environment: ${ bundle.parameters.arm_environment } + sql_sku: ${ bundle.parameters.sql_sku } backendConfig: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } diff --git a/templates/workspace_services/gitea/template_schema.json b/templates/workspace_services/gitea/template_schema.json index d9f10c1d8d..542ac95287 100644 --- a/templates/workspace_services/gitea/template_schema.json +++ b/templates/workspace_services/gitea/template_schema.json @@ -27,6 +27,18 @@ "description": "Long form description of the workspace service, in markdown syntax", "default": "Gitea is a lightweight DevOps platform. Features include code hosting, code review, CI/CD, project management and package management. Documentation can be found here: [https://docs.gitea.com/](https://docs.gitea.com/).", "updateable": true + }, + "sql_sku": { + "$id": "#/properties/sql_sku", + "type": "string", + "title": "MySQL server SKU", + "description": "MySQL server SKU", + "enum": [ + "B | 4GB 2vCores", + "GP | 8GB 2vCores", + "BC | 16GB 2vCores" + ], + "default": "B | 4GB 2vCores" }, "is_exposed_externally": { "$id": "#/properties/is_exposed_externally", From bec628e65d77a37abcec1e85e28a223396f24355 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 10:53:08 +0000 Subject: [PATCH 18/28] "updateable": true --- templates/shared_services/gitea/porter.yaml | 2 +- templates/shared_services/gitea/template_schema.json | 1 + templates/workspace_services/gitea/porter.yaml | 2 +- templates/workspace_services/gitea/template_schema.json | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 73bfa78a46..e6c2fc70b8 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 1.0.0 +version: 1.0.1 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/gitea/template_schema.json b/templates/shared_services/gitea/template_schema.json index 442594b9e5..7534361c77 100644 --- a/templates/shared_services/gitea/template_schema.json +++ b/templates/shared_services/gitea/template_schema.json @@ -32,6 +32,7 @@ "type": "string", "title": "MySQL server SKU", "description": "MySQL server SKU", + "updateable": true, "enum": [ "B | 4GB 2vCores", "GP | 8GB 2vCores", diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index 3e386e74c0..4fdea8df7f 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.10 +version: 0.8.11 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/gitea/template_schema.json b/templates/workspace_services/gitea/template_schema.json index 542ac95287..ef53192e76 100644 --- a/templates/workspace_services/gitea/template_schema.json +++ b/templates/workspace_services/gitea/template_schema.json @@ -33,6 +33,7 @@ "type": "string", "title": "MySQL server SKU", "description": "MySQL server SKU", + "updateable": true, "enum": [ "B | 4GB 2vCores", "GP | 8GB 2vCores", From 3256d01b2a195bcce5cf76b98e18fc976b4e297b Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 10:57:49 +0000 Subject: [PATCH 19/28] ignore zones --- templates/shared_services/gitea/porter.yaml | 2 +- templates/shared_services/gitea/terraform/mysql.tf | 2 +- templates/workspace_services/gitea/terraform/mysql.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index e6c2fc70b8..5c49293e65 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 1.0.1 +version: 1.0.2 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index eef86e3e5b..08825fbfe7 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -18,7 +18,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { geo_redundant_backup_enabled = false tags = local.tre_shared_service_tags - lifecycle { ignore_changes = [tags] } + lifecycle { ignore_changes = [tags, zones] } } resource "azurerm_mysql_database" "gitea" { diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index 3b258d173d..237bc91d11 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -18,7 +18,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { geo_redundant_backup_enabled = false tags = local.workspace_service_tags - lifecycle { ignore_changes = [tags] } + lifecycle { ignore_changes = [tags, zones] } } resource "azurerm_mysql_database" "gitea" { From 1aaf7367f4f0ef08e5c08337c1c8d46e31abc7cf Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 10:59:31 +0000 Subject: [PATCH 20/28] zone --- templates/shared_services/gitea/porter.yaml | 2 +- templates/shared_services/gitea/terraform/mysql.tf | 2 +- templates/workspace_services/gitea/terraform/mysql.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 5c49293e65..384ba69b4d 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 1.0.2 +version: 1.0.3 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index 08825fbfe7..3485a66941 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -18,7 +18,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { geo_redundant_backup_enabled = false tags = local.tre_shared_service_tags - lifecycle { ignore_changes = [tags, zones] } + lifecycle { ignore_changes = [tags, zone] } } resource "azurerm_mysql_database" "gitea" { diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index 237bc91d11..c8a8e6b981 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -18,7 +18,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { geo_redundant_backup_enabled = false tags = local.workspace_service_tags - lifecycle { ignore_changes = [tags, zones] } + lifecycle { ignore_changes = [tags, zone] } } resource "azurerm_mysql_database" "gitea" { From e936b3178f72cf6554b17584b9882c02ff10ad97 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 11:08:12 +0000 Subject: [PATCH 21/28] update to azurerm_mysql_flexible_database --- templates/shared_services/gitea/terraform/gitea-webapp.tf | 2 +- templates/shared_services/gitea/terraform/mysql.tf | 2 +- templates/workspace_services/gitea/porter.yaml | 2 +- templates/workspace_services/gitea/terraform/gitea-webapp.tf | 2 +- templates/workspace_services/gitea/terraform/mysql.tf | 2 +- templates/workspace_services/mysql/porter.yaml | 2 +- templates/workspace_services/mysql/terraform/mysql.tf | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/shared_services/gitea/terraform/gitea-webapp.tf b/templates/shared_services/gitea/terraform/gitea-webapp.tf index d22f969c77..00ac95c03b 100644 --- a/templates/shared_services/gitea/terraform/gitea-webapp.tf +++ b/templates/shared_services/gitea/terraform/gitea-webapp.tf @@ -47,7 +47,7 @@ resource "azurerm_linux_web_app" "gitea" { GITEA__database__SSL_MODE = "true" GITEA__database__DB_TYPE = "mysql" GITEA__database__HOST = azurerm_mysql_flexible_server.gitea.fqdn - GITEA__database__NAME = azurerm_mysql_database.gitea.name + GITEA__database__NAME = azurerm_mysql_flexible_database.gitea.name GITEA__database__USER = "${azurerm_mysql_flexible_server.gitea.administrator_login}@${azurerm_mysql_flexible_server.gitea.fqdn}" GITEA__database__PASSWD = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.db_password.id})" } diff --git a/templates/shared_services/gitea/terraform/mysql.tf b/templates/shared_services/gitea/terraform/mysql.tf index 3485a66941..33d4a0fe9f 100644 --- a/templates/shared_services/gitea/terraform/mysql.tf +++ b/templates/shared_services/gitea/terraform/mysql.tf @@ -21,7 +21,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { lifecycle { ignore_changes = [tags, zone] } } -resource "azurerm_mysql_database" "gitea" { +resource "azurerm_mysql_flexible_database" "gitea" { name = "gitea" resource_group_name = local.core_resource_group_name server_name = azurerm_mysql_flexible_server.gitea.name diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index 4fdea8df7f..f3b34ddab5 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.11 +version: 0.8.12 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/gitea/terraform/gitea-webapp.tf b/templates/workspace_services/gitea/terraform/gitea-webapp.tf index 4b8a8c3a01..47fea66799 100644 --- a/templates/workspace_services/gitea/terraform/gitea-webapp.tf +++ b/templates/workspace_services/gitea/terraform/gitea-webapp.tf @@ -57,7 +57,7 @@ resource "azurerm_linux_web_app" "gitea" { GITEA__database__SSL_MODE = "true" GITEA__database__DB_TYPE = "mysql" GITEA__database__HOST = azurerm_mysql_flexible_server.gitea.fqdn - GITEA__database__NAME = azurerm_mysql_database.gitea.name + GITEA__database__NAME = azurerm_mysql_flexible_database.gitea.name GITEA__database__USER = "${azurerm_mysql_flexible_server.gitea.administrator_login}@${azurerm_mysql_flexible_server.gitea.fqdn}" GITEA__database__PASSWD = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.db_password.id})" } diff --git a/templates/workspace_services/gitea/terraform/mysql.tf b/templates/workspace_services/gitea/terraform/mysql.tf index c8a8e6b981..ce03f835c7 100644 --- a/templates/workspace_services/gitea/terraform/mysql.tf +++ b/templates/workspace_services/gitea/terraform/mysql.tf @@ -21,7 +21,7 @@ resource "azurerm_mysql_flexible_server" "gitea" { lifecycle { ignore_changes = [tags, zone] } } -resource "azurerm_mysql_database" "gitea" { +resource "azurerm_mysql_flexible_database" "gitea" { name = "gitea" resource_group_name = data.azurerm_resource_group.ws.name server_name = azurerm_mysql_flexible_server.gitea.name diff --git a/templates/workspace_services/mysql/porter.yaml b/templates/workspace_services/mysql/porter.yaml index 1f020a5470..f30dd50b3b 100644 --- a/templates/workspace_services/mysql/porter.yaml +++ b/templates/workspace_services/mysql/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-mysql -version: 0.4.6 +version: 0.4.7 description: "A MySQL workspace service" registry: azuretre dockerfile: Dockerfile.tmpl diff --git a/templates/workspace_services/mysql/terraform/mysql.tf b/templates/workspace_services/mysql/terraform/mysql.tf index 9ae1232ce1..2b0daf029b 100644 --- a/templates/workspace_services/mysql/terraform/mysql.tf +++ b/templates/workspace_services/mysql/terraform/mysql.tf @@ -20,7 +20,7 @@ resource "azurerm_mysql_flexible_server" "mysql" { lifecycle { ignore_changes = [tags] } } -resource "azurerm_mysql_database" "db" { +resource "azurerm_mysql_flexible_database" "db" { name = var.db_name resource_group_name = data.azurerm_resource_group.ws.name server_name = azurerm_mysql_flexible_server.mysql.name From 0471e5297b8c3831bc9e125785ac6300b1f579b7 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 11:29:28 +0000 Subject: [PATCH 22/28] update --- templates/shared_services/gitea/porter.yaml | 2 +- templates/workspace_services/mysql/porter.yaml | 2 +- templates/workspace_services/mysql/template_schema.json | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 384ba69b4d..cbd3160789 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 1.0.3 +version: 1.0.4 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/mysql/porter.yaml b/templates/workspace_services/mysql/porter.yaml index f30dd50b3b..98a4f2a491 100644 --- a/templates/workspace_services/mysql/porter.yaml +++ b/templates/workspace_services/mysql/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-mysql -version: 0.4.7 +version: 0.4.8 description: "A MySQL workspace service" registry: azuretre dockerfile: Dockerfile.tmpl diff --git a/templates/workspace_services/mysql/template_schema.json b/templates/workspace_services/mysql/template_schema.json index 5182879012..d0cafd2bf9 100644 --- a/templates/workspace_services/mysql/template_schema.json +++ b/templates/workspace_services/mysql/template_schema.json @@ -11,6 +11,7 @@ "type": "string", "title": "MySQL server SKU", "description": "MySQL server SKU", + "updateable": true, "enum": [ "B | 4GB 2vCores", "GP | 8GB 2vCores", @@ -29,7 +30,8 @@ "$id": "#/properties/db_name", "type": "string", "title": "Database name", - "description": "Database name" + "description": "Database name", + "default": "tredb" } } } From a6c0ce3fbca20511ae3d8935cd17e0b0e8619481 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 11:30:30 +0000 Subject: [PATCH 23/28] add password --- templates/workspace_services/mysql/terraform/mysql.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/workspace_services/mysql/terraform/mysql.tf b/templates/workspace_services/mysql/terraform/mysql.tf index 2b0daf029b..09d188e2eb 100644 --- a/templates/workspace_services/mysql/terraform/mysql.tf +++ b/templates/workspace_services/mysql/terraform/mysql.tf @@ -11,13 +11,14 @@ resource "azurerm_mysql_flexible_server" "mysql" { resource_group_name = data.azurerm_resource_group.ws.name location = data.azurerm_resource_group.ws.location administrator_login = "mysqladmin" + administrator_password = random_password.password.result sku_name = local.sql_sku[var.sql_sku].value version = "8.0.21" backup_retention_days = 7 geo_redundant_backup_enabled = false tags = local.workspace_service_tags - lifecycle { ignore_changes = [tags] } + lifecycle { ignore_changes = [tags, zone] } } resource "azurerm_mysql_flexible_database" "db" { From 80bd9afcd905370c20bb55c46a3a64b0ec48530a Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 12:27:54 +0000 Subject: [PATCH 24/28] update sku list --- templates/workspace_services/gitea/porter.yaml | 2 +- templates/workspace_services/gitea/terraform/locals.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index f3b34ddab5..baf7586517 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.12 +version: 0.8.13 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/gitea/terraform/locals.tf b/templates/workspace_services/gitea/terraform/locals.tf index 35a5ca7370..f37c1e270a 100644 --- a/templates/workspace_services/gitea/terraform/locals.tf +++ b/templates/workspace_services/gitea/terraform/locals.tf @@ -10,7 +10,7 @@ locals { version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "") sql_sku = { "B | 4GB 2vCores" = { value = "B_Standard_B2s" }, - "GP | 8GB 2vCores" = { value = "GP_Standard_D2ads_v5" }, + "GP | 8GB 2vCores" = { value = "GP_Standard_D2ds_v4" }, "BC | 16GB 2vCores" = { value = "MO_Standard_E2ds_v4" } } workspace_service_tags = { From 767d3f3728770a64732063910ba730847f20219b Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Tue, 2 Apr 2024 16:23:22 +0000 Subject: [PATCH 25/28] update user login details for mysql --- templates/shared_services/gitea/porter.yaml | 2 +- templates/shared_services/gitea/terraform/gitea-webapp.tf | 2 +- templates/workspace_services/gitea/porter.yaml | 2 +- templates/workspace_services/gitea/terraform/gitea-webapp.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index cbd3160789..51fb4be6bf 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 1.0.4 +version: 1.0.5 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/gitea/terraform/gitea-webapp.tf b/templates/shared_services/gitea/terraform/gitea-webapp.tf index 00ac95c03b..0fb5918777 100644 --- a/templates/shared_services/gitea/terraform/gitea-webapp.tf +++ b/templates/shared_services/gitea/terraform/gitea-webapp.tf @@ -48,7 +48,7 @@ resource "azurerm_linux_web_app" "gitea" { GITEA__database__DB_TYPE = "mysql" GITEA__database__HOST = azurerm_mysql_flexible_server.gitea.fqdn GITEA__database__NAME = azurerm_mysql_flexible_database.gitea.name - GITEA__database__USER = "${azurerm_mysql_flexible_server.gitea.administrator_login}@${azurerm_mysql_flexible_server.gitea.fqdn}" + GITEA__database__USER = azurerm_mysql_flexible_server.gitea.administrator_login GITEA__database__PASSWD = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.db_password.id})" } diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index baf7586517..d8eea84c7b 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.13 +version: 0.8.14 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/gitea/terraform/gitea-webapp.tf b/templates/workspace_services/gitea/terraform/gitea-webapp.tf index 47fea66799..c354a0ac84 100644 --- a/templates/workspace_services/gitea/terraform/gitea-webapp.tf +++ b/templates/workspace_services/gitea/terraform/gitea-webapp.tf @@ -58,7 +58,7 @@ resource "azurerm_linux_web_app" "gitea" { GITEA__database__DB_TYPE = "mysql" GITEA__database__HOST = azurerm_mysql_flexible_server.gitea.fqdn GITEA__database__NAME = azurerm_mysql_flexible_database.gitea.name - GITEA__database__USER = "${azurerm_mysql_flexible_server.gitea.administrator_login}@${azurerm_mysql_flexible_server.gitea.fqdn}" + GITEA__database__USER = azurerm_mysql_flexible_server.gitea.administrator_login GITEA__database__PASSWD = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.db_password.id})" } From 98ac55fa215e80335bfab049615f6b4219dd3b2b Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 3 Apr 2024 09:42:30 +0100 Subject: [PATCH 26/28] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5024fd286..cbf85f721f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ BUG FIXES: * Airlock: Creating an import/export request causes a routing error ([#3830](https://github.com/microsoft/AzureTRE/issues/3830)) * Fix registration of templates with no 'authorizedRoles' or 'required' defined ([#3849](https://github.com/microsoft/AzureTRE/pull/3849)) * Update terraform for services bus to move network rules into namespace resource to avoid depreciation warning, and update setup_local_debugging.sh to use network_rule_sets ([#3858](https://github.com/microsoft/AzureTRE/pull/3858)) +* Update terraform MySQL resources to MySQL Flexible resources to fix depricating recources. ([#3892](https://github.com/microsoft/AzureTRE/pull/3892)) COMPONENTS: From 96ca5a3f1234eb91bf82b071a3756e8e806c5071 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 3 Apr 2024 13:18:21 +0100 Subject: [PATCH 27/28] doc updates and version updates --- docs/tre-templates/shared-services/gitea.md | 4 +++ .../tre-templates/workspace-services/gitea.md | 4 +++ .../tre-templates/workspace-services/mysql.md | 22 ++++++++++++++++ templates/shared_services/gitea/porter.yaml | 2 +- .../shared_services/gitea/terraform/locals.tf | 2 +- .../workspace_services/gitea/porter.yaml | 2 +- .../workspace_services/mysql/porter.yaml | 25 ++++++++++++++----- .../mysql/terraform/locals.tf | 2 +- 8 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 docs/tre-templates/workspace-services/mysql.md diff --git a/docs/tre-templates/shared-services/gitea.md b/docs/tre-templates/shared-services/gitea.md index b846d042b2..173611a5ae 100644 --- a/docs/tre-templates/shared-services/gitea.md +++ b/docs/tre-templates/shared-services/gitea.md @@ -47,3 +47,7 @@ Gitea needs to be able to access the following resource outside the Azure TRE VN | AzureActiveDirectory | Authorize the signed in user against Azure Active Directory. | | AzureContainerRegistry | Pull the Gitea container image, as it is located in Azure Container Registry. | | (www.)github.com | Allows Gitea to mirror any repo on GitHub | + +## Upgrading to version 1.0.0 + +Migrating existing Gitea services to the major version 1.0.0 is not currently supported. This is due to the breaking change in the Terraform to migrate from the deprecated mysql_server to the new mysql_flexible_server. diff --git a/docs/tre-templates/workspace-services/gitea.md b/docs/tre-templates/workspace-services/gitea.md index b62b9778aa..054e21bd67 100644 --- a/docs/tre-templates/workspace-services/gitea.md +++ b/docs/tre-templates/workspace-services/gitea.md @@ -24,3 +24,7 @@ The Gitea worskpace service opens outbound access to: 3. Click sign in with OpenID button and sign in with the same credentials used to access the workspace. 4. Once succesfully signed in choose a username. 5. Navigate to the user settings and under the account tab set a password for your account( `https:///user/settings/account` ). This username and passowrd should be used to authenticate against Gitea when carrying out git operations. + +## Upgrading to version 1.0.0 + +Migrating existing Gitea services to the major version 1.0.0 is not currently supported. This is due to the breaking change in the Terraform to migrate from the deprecated mysql_server to the new mysql_flexible_server. \ No newline at end of file diff --git a/docs/tre-templates/workspace-services/mysql.md b/docs/tre-templates/workspace-services/mysql.md new file mode 100644 index 0000000000..8d000135fc --- /dev/null +++ b/docs/tre-templates/workspace-services/mysql.md @@ -0,0 +1,22 @@ +# MySQL Workspace Service + +See: [MySQL Azure](https://learn.microsoft.com/en-GB/azure/mysql/) + +## Prerequisites + +- [A base workspace deployed](../workspaces/base.md) + +- The MySQL workspace service container image needs building and pushing: + + `make workspace_service_bundle BUNDLE=mysql` + +## Authenticating to MySQL + +1. Navigate to the MySQL workspace service using the `Mysql fqdn` from the details tab. +2. Using the Password found in Key Vault and the Username `mysqladmin` +3. Connect to the MySQL server on a VM with the following command shown below + `mysql -h [fqdn] -u [username] -p [password]` + +## Upgrading to version 1.0.0 + +Migrating existing MySQL services to the major version 1.0.0 is not currently supported. This is due to the breaking change in the Terraform to migrate from the deprecated mysql_server to the new mysql_flexible_server. \ No newline at end of file diff --git a/templates/shared_services/gitea/porter.yaml b/templates/shared_services/gitea/porter.yaml index 51fb4be6bf..e6c2fc70b8 100644 --- a/templates/shared_services/gitea/porter.yaml +++ b/templates/shared_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-gitea -version: 1.0.5 +version: 1.0.1 description: "A Gitea shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/gitea/terraform/locals.tf b/templates/shared_services/gitea/terraform/locals.tf index 8668ed35a3..5322583f29 100644 --- a/templates/shared_services/gitea/terraform/locals.tf +++ b/templates/shared_services/gitea/terraform/locals.tf @@ -8,7 +8,7 @@ locals { gitea_allowed_fqdns_list = distinct(compact(split(",", replace(var.gitea_allowed_fqdns, " ", "")))) sql_sku = { "B | 4GB 2vCores" = { value = "B_Standard_B2s" }, - "GP | 8GB 2vCores" = { value = "GP_Standard_D2ads_v5" }, + "GP | 8GB 2vCores" = { value = "GP_Standard_D2ds_v4" }, "BC | 16GB 2vCores" = { value = "MO_Standard_E2ds_v4" } } tre_shared_service_tags = { diff --git a/templates/workspace_services/gitea/porter.yaml b/templates/workspace_services/gitea/porter.yaml index d8eea84c7b..6c5f739872 100644 --- a/templates/workspace_services/gitea/porter.yaml +++ b/templates/workspace_services/gitea/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-gitea -version: 0.8.14 +version: 1.0.1 description: "A Gitea workspace service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/mysql/porter.yaml b/templates/workspace_services/mysql/porter.yaml index 98a4f2a491..7f7baccfe1 100644 --- a/templates/workspace_services/mysql/porter.yaml +++ b/templates/workspace_services/mysql/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-workspace-service-mysql -version: 0.4.8 +version: 1.0.1 description: "A MySQL workspace service" registry: azuretre dockerfile: Dockerfile.tmpl @@ -65,6 +65,7 @@ outputs: type: string applyTo: - install + - upgrade install: - terraform: @@ -85,11 +86,23 @@ install: outputs: - name: mysql_fqdn upgrade: - - exec: - description: "Upgrade shared service" - command: echo - arguments: - - "This shared service does not implement upgrade action" + - terraform: + description: "Upgrade MySQL workspace service" + vars: + workspace_id: ${ bundle.parameters.workspace_id } + tre_id: ${ bundle.parameters.tre_id } + tre_resource_id: ${ bundle.parameters.id } + sql_sku: ${ bundle.parameters.sql_sku } + storage_mb: ${ bundle.parameters.storage_mb } + db_name: ${ bundle.parameters.db_name } + arm_environment: ${ bundle.parameters.arm_environment } + backendConfig: + resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } + storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } + container_name: ${ bundle.parameters.tfstate_container_name } + key: tre-workspace-service-mysql-${ bundle.parameters.id } + outputs: + - name: mysql_fqdn uninstall: - terraform: description: "Tear down MySQL workspace service" diff --git a/templates/workspace_services/mysql/terraform/locals.tf b/templates/workspace_services/mysql/terraform/locals.tf index ca3a236e47..296c0b93e7 100644 --- a/templates/workspace_services/mysql/terraform/locals.tf +++ b/templates/workspace_services/mysql/terraform/locals.tf @@ -7,7 +7,7 @@ locals { core_resource_group_name = "rg-${var.tre_id}" sql_sku = { "B | 4GB 2vCores" = { value = "B_Standard_B2s" }, - "GP | 8GB 2vCores" = { value = "GP_Standard_D2ads_v5" }, + "GP | 8GB 2vCores" = { value = "GP_Standard_D2ds_v4" }, "BC | 16GB 2vCores" = { value = "MO_Standard_E2ds_v4" } } workspace_service_tags = { From a9cae0a025d033180de26ddb2e76fdaa03eab63e Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 3 Apr 2024 14:19:26 +0100 Subject: [PATCH 28/28] resolving comments --- .markdownlint.json | 2 +- README.md | 9 ++++----- templates/shared_services/gitea/template_schema.json | 2 +- templates/workspace_services/gitea/parameters.json | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.markdownlint.json b/.markdownlint.json index e515e6f847..3ffa116956 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -13,4 +13,4 @@ "MD033": false, "MD036": false, "blank_lines": false -} \ No newline at end of file +} diff --git a/README.md b/README.md index ed842400b3..4bcb9bcc3e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ **Azure TRE documentation site**: ## Background - Across the health industry, be it a pharmaceutical company interrogating clinical trial results, or a public health provider analyzing electronic health records, there is the need to enable researchers, analysts, and developers to work with sensitive data sets. @@ -19,7 +18,6 @@ This project is typically implemented alongside a data platform that provides re TREs are not “one size fits all”, hence although the Azure TRE has a number of out of the box features, the project has been built be extensible, and hence tooling and data platform agnostic. Core features include: - - Self-service workspace management for TRE administrators - Self-service provisioning of research tooling for research teams - Package and repository mirroring - PyPi, R-CRAN, Apt and more. @@ -27,7 +25,7 @@ Core features include: - Azure Active Directory integration - Airlock - import and export - Cost reporting -- Ready to workspace templates including: +- Ready to workspace templates including: - Restricted with data exfiltration control - Unrestricted for open data - Ready to go workspace service templates including: @@ -38,7 +36,7 @@ Core features include: ## Project Status and Support -**_This project's code base is still under development and breaking changes will happen. Whilst the maintainers will do our best to minimise disruption to existing deployments, this may not always be possible. Stable releases will be published when the project is more mature._** +***This project's code base is still under development and breaking changes will happen. Whilst the maintainers will do our best to minimise disruption to existing deployments, this may not always be possible. Stable releases will be published when the project is more mature.*** The aim is to bring together learnings from past customer engagements where TREs have been built into a single reference solution. This is a solution accelerator aiming to be a great starting point for a customized TRE solution. You're encouraged to download and customize the solution to meet your requirements @@ -48,7 +46,7 @@ It is important before deployment of the solution that the [Support Policy](SUPP ## Contributing -This project welcomes contributions and suggestions. Most contributions require you to agree to a +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com). @@ -68,6 +66,7 @@ This project may contain trademarks or logos for projects, products, or services Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. + ## Repository structure ```text diff --git a/templates/shared_services/gitea/template_schema.json b/templates/shared_services/gitea/template_schema.json index 7534361c77..463a6715f0 100644 --- a/templates/shared_services/gitea/template_schema.json +++ b/templates/shared_services/gitea/template_schema.json @@ -162,4 +162,4 @@ } ] } -} \ No newline at end of file +} diff --git a/templates/workspace_services/gitea/parameters.json b/templates/workspace_services/gitea/parameters.json index 1b2be1a537..811e0a5f3b 100755 --- a/templates/workspace_services/gitea/parameters.json +++ b/templates/workspace_services/gitea/parameters.json @@ -71,4 +71,4 @@ } } ] -} \ No newline at end of file +}