Skip to content

Commit

Permalink
Add codename tulip database server as the new production DB
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagojsag committed Feb 23, 2023
1 parent a8c64a6 commit 27c99db
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 321 deletions.
14 changes: 14 additions & 0 deletions infrastructure/base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,20 @@ module "sql_server_production_14" {
postgresql_version = "14"
}

module "sql_server_production_tulip" {
count = var.deploy_production ? 1 : 0

source = "./modules/database"
resource_group = data.azurerm_resource_group.resource_group
project_name = "${var.project_name}-production-tulip"
subnet_id = module.network.sql_subnet_id
private_dns_zone_id = module.sql_server_private_dns_zone.dns_zone_id
key_vault_id = module.sql_server_key_vault.key_vault_id
instance_size = var.production_db_instance_size
storage_size = var.production_db_storage_size
postgresql_version = "14"
}

module "sql_server_staging" {
source = "./modules/database"
resource_group = data.azurerm_resource_group.resource_group
Expand Down
18 changes: 18 additions & 0 deletions infrastructure/base/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@ output "sql_server_production_14_password" {
sensitive = true
}

output "sql_server_production_tulip_name" {
value = length(module.sql_server_production_tulip) > 0 ? module.sql_server_production_tulip[0].sql_server_name : null
}

output "sql_server_production_tulip_hostname" {
value = length(module.sql_server_production_tulip) > 0 ? module.sql_server_production_tulip[0].sql_server_url : null
}

output "sql_server_production_tulip_username" {
value = length(module.sql_server_production_tulip) > 0 ? module.sql_server_production_tulip[0].sql_server_username : null
sensitive = true
}

output "sql_server_production_tulip_password" {
value = length(module.sql_server_production_tulip) > 0 ? module.sql_server_production_tulip[0].sql_server_password : null
sensitive = true
}

output "sql_server_staging_name" {
value = module.sql_server_staging.sql_server_name
}
Expand Down
230 changes: 174 additions & 56 deletions infrastructure/kubernetes/main.tf

Large diffs are not rendered by default.

140 changes: 0 additions & 140 deletions infrastructure/kubernetes/modules/secrets/main.tf

This file was deleted.

106 changes: 0 additions & 106 deletions infrastructure/kubernetes/modules/secrets/variable.tf

This file was deleted.

19 changes: 0 additions & 19 deletions infrastructure/kubernetes/modules/secrets/versions.tf

This file was deleted.

11 changes: 11 additions & 0 deletions infrastructure/kubernetes/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ provider "postgresql" {
superuser = false
}

provider "postgresql" {
alias = "db_tunnel_production_tulip"

host = length(module.db_tunnel_production_tulip) > 0 ? module.db_tunnel_production_tulip[0].host : null
port = length(module.db_tunnel_production_tulip) > 0 ? module.db_tunnel_production_tulip[0].port : null
username =lookup(data.terraform_remote_state.core.outputs, "sql_server_production_tulip_username", null)
password =lookup(data.terraform_remote_state.core.outputs, "sql_server_production_tulip_password", null)
sslmode = "require"
superuser = false
}

provider "postgresql" {
alias = "db_tunnel_staging"

Expand Down

0 comments on commit 27c99db

Please sign in to comment.