Skip to content

Commit

Permalink
removed stg db (#3299)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblackmoor committed Jun 19, 2024
1 parent f6e7161 commit 8ab6f81
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 70 deletions.
1 change: 0 additions & 1 deletion infrastructure/stg.tfvars

This file was deleted.

39 changes: 0 additions & 39 deletions infrastructure/tf-db-flexible-secrets.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Postgres 15 flexible server store secrets in key vault
locals {
flexible_secret_prefix_staging = "${var.component}-staging-db-flexible"
standard_secret_prefix = "${var.component}-POSTGRES"

flexible_secrets = [
Expand All @@ -25,32 +24,6 @@ locals {
value = local.db_name
}
]

flexible_secrets_staging = var.env == "aat" ? [
{
name_suffix = "pass"
value = module.postgresql-staging[0].password
count = var.num_staging_dbs
},
{
name_suffix = "host"
value = module.postgresql-staging[0].fqdn
count = var.num_staging_dbs
},
{
name_suffix = "user"
value = module.postgresql-staging[0].username
count = var.num_staging_dbs
},
{
name_suffix = "port"
value = "5432"
},
{
name_suffix = "database"
value = local.db_name
}
]: []
}

resource "azurerm_key_vault_secret" "flexible_secret_standard_format" {
Expand All @@ -64,15 +37,3 @@ resource "azurerm_key_vault_secret" "flexible_secret_standard_format" {
content_type = ""
expiration_date = timeadd(timestamp(), "17520h")
}

resource "azurerm_key_vault_secret" "flexible_secret_staging" {
for_each = { for secret in local.flexible_secrets_staging : secret.name_suffix => secret }
key_vault_id = data.azurerm_key_vault.key_vault.id
name = "${local.flexible_secret_prefix_staging}-${each.value.name_suffix}"
value = each.value.value
tags = merge(var.common_tags, {
"source" : "${var.component} PostgreSQL"
})
content_type = ""
expiration_date = timeadd(timestamp(), "17520h")
}
26 changes: 0 additions & 26 deletions infrastructure/tf-db-flexible.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,3 @@ module "postgresql" {
force_schema_ownership_trigger = "true"
force_user_permissions_trigger = "1"
}

module "postgresql-staging" {
count = var.env == "aat" ? 1 : 0
providers = {
azurerm.postgres_network = azurerm.postgres_network
}
source = "git@github.com:hmcts/terraform-module-postgresql-flexible?ref=master"
name = "${local.db_host_name}-staging"
product = "${var.product}-${var.component}-staging"

component = var.component
location = var.location_db
env = "aat"
pgsql_admin_username = var.postgresql_user
pgsql_databases = [
{
name : var.database_name
}
]
common_tags = var.common_tags
business_area = "cft"
pgsql_version = "15"
subnet_suffix = "expanded"

admin_user_object_id = var.jenkins_AAD_objectId
}
4 changes: 0 additions & 4 deletions infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,3 @@ variable "postgresql_user" {
}

variable "aks_subscription_id" {}

variable "num_staging_dbs" {
default = 0
}

0 comments on commit 8ab6f81

Please sign in to comment.