Skip to content

Commit

Permalink
Merge pull request #886 from CDCgov/db_scaling
Browse files Browse the repository at this point in the history
Better Database Instance when Deployed in Higher Level Environment
  • Loading branch information
halprin authored Feb 16, 2024
2 parents 111906c + a62ad78 commit 71b4697
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"filename": "operations/template/db.tf",
"hashed_secret": "7cb6efb98ba5972a9b5090dc2e517fe14d12cb04",
"is_verified": false,
"line_number": 15,
"line_number": 16,
"is_secret": false
}
],
Expand All @@ -269,6 +269,5 @@
}
]
},
"generated_at": "2024-02-09T23:44:14Z"

"generated_at": "2024-02-16T15:55:01Z"
}
5 changes: 3 additions & 2 deletions operations/template/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ resource "azurerm_postgresql_flexible_server" "database" {
name = "cdcti-${var.environment}-database"
resource_group_name = data.azurerm_resource_group.group.name
location = data.azurerm_resource_group.group.location
sku_name = "B_Standard_B1ms"
sku_name = local.higher_environment_level ? "B_Standard_B2ms" : "B_Standard_B1ms"
version = "16"
storage_mb = "32768"
auto_grow_enabled = true
backup_retention_days = "14"

authentication {
Expand Down Expand Up @@ -48,4 +49,4 @@ resource "azurerm_postgresql_flexible_server_firewall_rule" "db_firewall_5" {
server_id = azurerm_postgresql_flexible_server.database.id
start_ip_address = "0.0.0.0"
end_ip_address = "0.0.0.0"
}
}
3 changes: 2 additions & 1 deletion operations/template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ locals {
}
selected_rs_environment_prefix = lookup(local.environment_to_rs_environment_prefix_mapping, var.environment, "staging")
rs_domain_prefix = "${local.selected_rs_environment_prefix}${length(local.selected_rs_environment_prefix) == 0 ? "" : "."}"
higher_environment_level = var.environment == "stg" || var.environment == "prd"
}

data "azurerm_resource_group" "group" {
name = "csels-rsti-${var.environment}-moderate-rg"
}

data "azurerm_client_config" "current" {}
data "azurerm_client_config" "current" {}

0 comments on commit 71b4697

Please sign in to comment.