Skip to content

Commit 48e840c

Browse files
feat: Azure Postgresql Flexible Server deployment
1 parent 83f8266 commit 48e840c

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

infrastructure/environments/poc/variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ENV_CONFIG=poc
33
AZURE_SUBSCRIPTION="Lung Cancer Screening - Dev"
44
HUB_SUBSCRIPTION="Lung Cancer Screening - Dev"
55
STORAGE_ACCOUNT_RG=rg-tfstate-poc-uks
6-
TERRAFORM_MODULES_REF=feat/public-container-app-env
6+
TERRAFORM_MODULES_REF=main
77
ENABLE_SOFT_DELETE=false
88
DOCKER_IMAGE=docker.io/nginxdemos/hello
99
DOCKER_IMAGE_TAG=latest

infrastructure/environments/poc/variables.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
deploy_database_as_container = true
1+
deploy_database_as_container = false
22
features = {
33
front_door = false
44
hub_and_spoke = false

infrastructure/modules/container-apps/data.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
data "azurerm_client_config" "current" {}
22

3-
# data "azuread_group" "postgres_sql_admin_group" {
4-
# display_name = var.postgres_sql_admin_group
5-
# }
3+
data "azuread_group" "postgres_sql_admin_group" {
4+
display_name = var.postgres_sql_admin_group
5+
}
66

77
data "azurerm_private_dns_zone" "storage" {
88
count = var.features.private_networking ? 1 : 0

infrastructure/modules/container-apps/output.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ output "internal_url" {
33
}
44

55
output "external_url" {
6-
value = var.features.front_door ? "https://${module.frontdoor_endpoint.custom_domains["${var.environment}-domain"].host_name}/" : null
6+
value = var.features.front_door ? "https://${module.frontdoor_endpoint[0].custom_domains["${var.environment}-domain"].host_name}/" : null
77
}

infrastructure/modules/container-apps/postgres.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module "postgres" {
2020

2121
backup_retention_days = var.postgres_backup_retention_days
2222
geo_redundant_backup_enabled = var.postgres_geo_redundant_backup_enabled
23-
postgresql_admin_object_id = "" #data.azuread_group.postgres_sql_admin_group.object_id
23+
postgresql_admin_object_id = data.azuread_group.postgres_sql_admin_group.object_id
2424
postgresql_admin_principal_name = var.postgres_sql_admin_group
2525
postgresql_admin_principal_type = "Group"
2626
administrator_login = local.database_user

infrastructure/terraform/main.tf

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ module "container-apps" {
4747
postgres_backup_retention_days = var.postgres_backup_retention_days
4848
postgres_geo_redundant_backup_enabled = var.postgres_geo_redundant_backup_enabled
4949
postgres_sku_name = var.postgres_sku_name
50-
# postgres_sql_admin_group = "postgres_${var.app_short_name}_${var.env_config}_uks_admin"
51-
postgres_sql_admin_group = "Azure-Lung-Cancer-Screening---Dev-Owner"
52-
postgres_storage_mb = var.postgres_storage_mb
53-
postgres_storage_tier = var.postgres_storage_tier
54-
postgres_subnet_id = var.deploy_infra ? module.infra[0].postgres_subnet_id : data.azurerm_subnet.postgres[0].id
55-
main_subnet_id = var.deploy_infra ? module.infra[0].main_subnet_id : data.azurerm_subnet.main[0].id
56-
seed_demo_data = var.seed_demo_data
57-
use_apex_domain = var.use_apex_domain
50+
postgres_sql_admin_group = "postgres_${var.app_short_name}_${var.env_config}_uks_admin"
51+
postgres_storage_mb = var.postgres_storage_mb
52+
postgres_storage_tier = var.postgres_storage_tier
53+
postgres_subnet_id = var.deploy_infra ? module.infra[0].postgres_subnet_id : data.azurerm_subnet.postgres[0].id
54+
main_subnet_id = var.deploy_infra ? module.infra[0].main_subnet_id : data.azurerm_subnet.main[0].id
55+
seed_demo_data = var.seed_demo_data
56+
use_apex_domain = var.use_apex_domain
5857
}

0 commit comments

Comments
 (0)