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

Cost Report - Tag Gitea shared service #1941

Merged
merged 12 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 9 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: 1 addition & 1 deletion templates/shared_services/gitea/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: tre-shared-service-gitea
version: 0.3.1
version: 0.3.3
description: "A Gitea shared service"
registry: azuretre
dockerfile: Dockerfile.tmpl
Expand Down
2 changes: 2 additions & 0 deletions templates/shared_services/gitea/terraform/gitea-webapp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resource "random_password" "gitea_passwd" {
resource "azurerm_user_assigned_identity" "gitea_id" {
resource_group_name = local.core_resource_group_name
location = data.azurerm_resource_group.rg.location
tags = local.tre_shared_service_tags

name = "id-gitea-${var.tre_id}"

Expand All @@ -23,6 +24,7 @@ resource "azurerm_app_service" "gitea" {
app_service_plan_id = data.azurerm_app_service_plan.core.id
https_only = true
key_vault_reference_identity_id = azurerm_user_assigned_identity.gitea_id.id
tags = local.tre_shared_service_tags

app_settings = {
APPINSIGHTS_INSTRUMENTATIONKEY = data.azurerm_application_insights.core.instrumentation_key
Expand Down
4 changes: 4 additions & 0 deletions templates/shared_services/gitea/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ 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, " ", ""))))
tre_shared_service_tags = {
tre_id = var.tre_id
tre_shared_service_id = var.tre_resource_id
}
}
20 changes: 13 additions & 7 deletions templates/shared_services/gitea/terraform/mysql.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ resource "random_password" "password" {
}

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
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
# Ignoring tflint due to a bug in it.
# TODO: https://github.com/microsoft/AzureTRE/issues/1944
# tflint-ignore: azurerm_mysql_server_invalid_version
version = "8.0"
auto_grow_enabled = true
backup_retention_days = 7
Expand All @@ -22,6 +25,7 @@ resource "azurerm_mysql_server" "gitea" {
public_network_access_enabled = false
ssl_enforcement_enabled = true
ssl_minimal_tls_version_enforced = "TLS1_2"
tags = local.tre_shared_service_tags

lifecycle { ignore_changes = [tags] }
}
Expand All @@ -39,6 +43,7 @@ resource "azurerm_private_endpoint" "private-endpoint" {
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
Expand All @@ -59,6 +64,7 @@ resource "azurerm_key_vault_secret" "db_password" {
name = "${azurerm_mysql_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

depends_on = [
azurerm_key_vault_access_policy.gitea_policy
Expand Down
2 changes: 1 addition & 1 deletion templates/shared_services/gitea/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.2"
__version__ = "0.3.3"