From 46851426326447538daa0b72484754a64c8afc03 Mon Sep 17 00:00:00 2001 From: Tope Emmanuel Date: Tue, 30 Apr 2024 15:53:31 +0100 Subject: [PATCH] Added required attributes to postgres and redis WHY: There is a required minimum standard setting for prod postgres and redis HOW: By setting HA, Maintenance window and SKU --- terraform/aks/databases.tf | 5 +++++ terraform/aks/variables.tf | 9 +++++++++ terraform/aks/workspace_variables/production.tfvars.json | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/terraform/aks/databases.tf b/terraform/aks/databases.tf index a19996b6..436ef309 100644 --- a/terraform/aks/databases.tf +++ b/terraform/aks/databases.tf @@ -16,6 +16,10 @@ module "postgres" { server_version = "14" azure_enable_backup_storage = var.azure_enable_backup_storage + + azure_sku_name = var.postgres_flexible_server_sku + azure_enable_high_availability = var.postgres_enable_high_availability + azure_maintenance_window = var.azure_maintenance_window } module "redis" { @@ -34,4 +38,5 @@ module "redis" { use_azure = var.deploy_azure_backing_services azure_enable_monitoring = var.enable_monitoring azure_patch_schedule = [{ "day_of_week" : "Sunday", "start_hour_utc" : 01 }] + azure_maxmemory_policy = "noeviction" } diff --git a/terraform/aks/variables.tf b/terraform/aks/variables.tf index 11e3b9f5..d6176786 100644 --- a/terraform/aks/variables.tf +++ b/terraform/aks/variables.tf @@ -45,6 +45,15 @@ variable "enable_monitoring" { default = false description = "Enable monitoring and alerting" } +variable "postgres_enable_high_availability" { + default = false +} +variable "postgres_flexible_server_sku" { + default = "B_Standard_B1ms" +} +variable "azure_maintenance_window" { + default = null +} variable "enable_postgres_ssl" { default = true diff --git a/terraform/aks/workspace_variables/production.tfvars.json b/terraform/aks/workspace_variables/production.tfvars.json index 0b8546ec..598786ca 100644 --- a/terraform/aks/workspace_variables/production.tfvars.json +++ b/terraform/aks/workspace_variables/production.tfvars.json @@ -8,6 +8,13 @@ "config_short": "pd", "service_short": "faltrn", "app_key_vault": "s189p01-faltrn-pd-app-kv", + "postgres_flexible_server_sku": "GP_Standard_D2ds_v4", + "postgres_enable_high_availability": true, + "azure_maintenance_window": { + "day_of_week": 0, + "start_hour": 3, + "start_minute": 0 + }, "statuscake_alerts": { "alert": { "website_url": [