Skip to content

Commit

Permalink
ops: added autoscale_settings vars for MongoDB db (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf committed Nov 15, 2024
1 parent 3559106 commit 3db8bcf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ secrets_names = {
"MONGODB_CONNECTION_URI" = "mongodb-connection-string"
"JWT_TOKEN_PUBLIC_KEY" = "jwt-public-key"
}

autoscale_settings = [{
max_throughput = 1000
}]
7 changes: 7 additions & 0 deletions infra/container_apps/user-group-ms/mongo_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ resource "azurerm_cosmosdb_mongo_database" "selc_user_group" {
name = "selcUserGroup"
resource_group_name = local.mongo_db.mongodb_rg_name
account_name = local.mongo_db.cosmosdb_account_mongodb_name

dynamic "autoscale_settings" {
for_each = var.autoscale_settings
content {
max_throughput = autoscale_settings.value.max_throughput
}
}
}

resource "azurerm_management_lock" "mongodb_selc_user_group" {
Expand Down
8 changes: 8 additions & 0 deletions infra/container_apps/user-group-ms/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ variable "suffix_increment" {
description = "Suffix increment Container App Environment name"
default = ""
}

variable "autoscale_settings" {
type = list(object({
max_throughput = number
}))
description = "MongoDB autoscale settings"
default = []
}

0 comments on commit 3db8bcf

Please sign in to comment.