Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos review #104

Merged
merged 4 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/env/dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ aks_max_count = null
# aks_vm_size = "Standard_B4ms" TODO apply in maintenence window

# CosmosDb MongoDb
cosmosdb_mongodb_extra_capabilities = ["EnableServerless"]
cosmosdb_mongodb_extra_capabilities = ["EnableServerless"]
cosmosdb_mongodb_main_geo_location_zone_redundant = false

# postgres
postgres_sku_name = "GP_Gen5_2"
Expand Down
10 changes: 6 additions & 4 deletions src/core/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,20 @@ aks_enable_auto_scaling = true
aks_min_count = 1
aks_max_count = 3
aks_upgrade_settings_max_surge = "33%"
aks_vm_size = "Standard_D4s_v4"
aks_vm_size = "Standard_D4s_v5"
aks_sku_tier = "Paid"

# CosmosDb MongoDb
cosmosdb_mongodb_enable_serverless = false
cosmosdb_mongodb_enable_autoscaling = true
# cosmosdb_mongodb_max_throughput TODO define before launch
cosmosdb_mongodb_enable_free_tier = true
cosmosdb_mongodb_additional_geo_locations = {
cosmosdb_mongodb_enable_free_tier = true
cosmosdb_mongodb_main_geo_location_zone_redundant = false
cosmosdb_mongodb_additional_geo_locations = [{
location = "northeurope"
failover_priority = 1
}
zone_redundant = false
}]

#postgres
postgres_sku_name = "GP_Gen5_2"
Expand Down
3 changes: 2 additions & 1 deletion src/core/env/uat/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ aks_max_count = null
# aks_vm_size = "Standard_B4ms" TODO apply in maintenence window

# CosmosDb MongoDb
cosmosdb_mongodb_enable_serverless = true
# cosmosdb_mongodb_extra_capabilities = ["EnableServerless"] TODO apply in maintenence window
cosmosdb_mongodb_main_geo_location_zone_redundant = false

# postgres
postgres_sku_name = "GP_Gen5_2"
Expand Down
6 changes: 5 additions & 1 deletion src/core/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ terraform {
}

provider "azurerm" {
features {}
features {
key_vault {
purge_soft_delete_on_destroy = false
}
}
}

data "azurerm_subscription" "current" {}
Expand Down
5 changes: 3 additions & 2 deletions src/core/mongodb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "cosmosdb_mongodb_snet" {
}

module "cosmosdb_account_mongodb" {
source = "git::https://github.com/pagopa/azurerm.git//cosmosdb?ref=v2.0.5"
source = "git::https://github.com/pagopa/azurerm.git//cosmosdb?ref=v2.0.19"

name = format("%s-cosmosdb-mongodb-account", local.project)
location = azurerm_resource_group.mongodb_rg.location
Expand All @@ -42,7 +42,8 @@ module "cosmosdb_account_mongodb" {

consistency_policy = var.cosmosdb_mongodb_consistency_policy

main_geo_location_location = azurerm_resource_group.mongodb_rg.location
main_geo_location_location = azurerm_resource_group.mongodb_rg.location
main_geo_location_zone_redundant = var.cosmosdb_mongodb_main_geo_location_zone_redundant

additional_geo_locations = var.cosmosdb_mongodb_additional_geo_locations

Expand Down
6 changes: 6 additions & 0 deletions src/core/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,16 @@ variable "cosmosdb_mongodb_consistency_policy" {
}
}

variable "cosmosdb_mongodb_main_geo_location_zone_redundant" {
type = bool
description = "Enable zone redundant Comsmos DB"
}

variable "cosmosdb_mongodb_additional_geo_locations" {
type = list(object({
location = string
failover_priority = number
zone_redundant = bool
}))
description = "The name of the Azure region to host replicated data and the priority to apply starting from 1. Not used when cosmosdb_mongodb_enable_serverless"
default = []
Expand Down