Skip to content

Commit 8ab6f81

Browse files
author
Josh
authored
removed stg db (#3299)
1 parent f6e7161 commit 8ab6f81

File tree

4 files changed

+0
-70
lines changed

4 files changed

+0
-70
lines changed

infrastructure/stg.tfvars

-1
This file was deleted.
-39
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Postgres 15 flexible server store secrets in key vault
22
locals {
3-
flexible_secret_prefix_staging = "${var.component}-staging-db-flexible"
43
standard_secret_prefix = "${var.component}-POSTGRES"
54

65
flexible_secrets = [
@@ -25,32 +24,6 @@ locals {
2524
value = local.db_name
2625
}
2726
]
28-
29-
flexible_secrets_staging = var.env == "aat" ? [
30-
{
31-
name_suffix = "pass"
32-
value = module.postgresql-staging[0].password
33-
count = var.num_staging_dbs
34-
},
35-
{
36-
name_suffix = "host"
37-
value = module.postgresql-staging[0].fqdn
38-
count = var.num_staging_dbs
39-
},
40-
{
41-
name_suffix = "user"
42-
value = module.postgresql-staging[0].username
43-
count = var.num_staging_dbs
44-
},
45-
{
46-
name_suffix = "port"
47-
value = "5432"
48-
},
49-
{
50-
name_suffix = "database"
51-
value = local.db_name
52-
}
53-
]: []
5427
}
5528

5629
resource "azurerm_key_vault_secret" "flexible_secret_standard_format" {
@@ -64,15 +37,3 @@ resource "azurerm_key_vault_secret" "flexible_secret_standard_format" {
6437
content_type = ""
6538
expiration_date = timeadd(timestamp(), "17520h")
6639
}
67-
68-
resource "azurerm_key_vault_secret" "flexible_secret_staging" {
69-
for_each = { for secret in local.flexible_secrets_staging : secret.name_suffix => secret }
70-
key_vault_id = data.azurerm_key_vault.key_vault.id
71-
name = "${local.flexible_secret_prefix_staging}-${each.value.name_suffix}"
72-
value = each.value.value
73-
tags = merge(var.common_tags, {
74-
"source" : "${var.component} PostgreSQL"
75-
})
76-
content_type = ""
77-
expiration_date = timeadd(timestamp(), "17520h")
78-
}

infrastructure/tf-db-flexible.tf

-26
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,3 @@ module "postgresql" {
3232
force_schema_ownership_trigger = "true"
3333
force_user_permissions_trigger = "1"
3434
}
35-
36-
module "postgresql-staging" {
37-
count = var.env == "aat" ? 1 : 0
38-
providers = {
39-
azurerm.postgres_network = azurerm.postgres_network
40-
}
41-
source = "[email protected]:hmcts/terraform-module-postgresql-flexible?ref=master"
42-
name = "${local.db_host_name}-staging"
43-
product = "${var.product}-${var.component}-staging"
44-
45-
component = var.component
46-
location = var.location_db
47-
env = "aat"
48-
pgsql_admin_username = var.postgresql_user
49-
pgsql_databases = [
50-
{
51-
name : var.database_name
52-
}
53-
]
54-
common_tags = var.common_tags
55-
business_area = "cft"
56-
pgsql_version = "15"
57-
subnet_suffix = "expanded"
58-
59-
admin_user_object_id = var.jenkins_AAD_objectId
60-
}

infrastructure/variables.tf

-4
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,3 @@ variable "postgresql_user" {
165165
}
166166

167167
variable "aks_subscription_id" {}
168-
169-
variable "num_staging_dbs" {
170-
default = 0
171-
}

0 commit comments

Comments
 (0)