Skip to content

Commit

Permalink
feat: [CHK-3284] add user-stats collection (#2453)
Browse files Browse the repository at this point in the history
* feat: add user-stats collection

* fix: shard_key

* fix: add ttl

---------

Co-authored-by: Pietro Tota <[email protected]>
Co-authored-by: Pietro Tota <[email protected]>
Co-authored-by: Simone infante <[email protected]>
  • Loading branch information
4 people authored Oct 9, 2024
1 parent e2b40b5 commit 768e269
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/domains/ecommerce-common/03_cosmosdb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ locals {
unique = true
}
]
shard_key = null
shard_key = null,
default_ttl_seconds = null
},
{
name = "eventstore"
Expand All @@ -99,7 +100,8 @@ locals {
unique = false
}
]
shard_key = "transactionId"
shard_key = "transactionId",
default_ttl_seconds = null
},
{
name = "transactions-view"
Expand All @@ -124,7 +126,8 @@ locals {
unique = false
}
]
shard_key = "_id"
shard_key = "_id",
default_ttl_seconds = null
},
{
name = "dead-letter-events"
Expand All @@ -141,7 +144,18 @@ locals {
unique = false
}
]
shard_key = "_id"
shard_key = "_id",
default_ttl_seconds = null
},
{
name = "user-stats"
indexes = [{
keys = ["_id"]
unique = true
}
]
shard_key = "_id",
default_ttl_seconds = "31536000" #1 year
},
]
}
Expand All @@ -162,9 +176,10 @@ module "cosmosdb_ecommerce_collections" {
cosmosdb_mongo_account_name = module.cosmosdb_account_mongodb.name
cosmosdb_mongo_database_name = azurerm_cosmosdb_mongo_database.ecommerce.name

indexes = each.value.indexes
shard_key = each.value.shard_key
lock_enable = var.env_short == "d" ? false : true
indexes = each.value.indexes
shard_key = each.value.shard_key
default_ttl_seconds = each.value.default_ttl_seconds
lock_enable = var.env_short == "d" ? false : true
}

# -----------------------------------------------
Expand Down

0 comments on commit 768e269

Please sign in to comment.