From 23a40b2d80778ca5ce4165ea62e3cddaff3fe4ac Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Tue, 9 Jul 2024 14:54:59 +0100 Subject: [PATCH] Added maintenance window for prod postgress - Configured the maintenance window to occur on Sunday at 2 AM when there is minimal application traffic. This ensures that any necessary updates or maintenance tasks are performed during a low-traffic period, minimizing impact on users. --- .../application/config/production/variables.tfvars.json | 5 +++++ terraform/application/databases.tf | 2 ++ terraform/application/variables.tf | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/terraform/application/config/production/variables.tfvars.json b/terraform/application/config/production/variables.tfvars.json index 84f9b5d79c..96ba5250bd 100644 --- a/terraform/application/config/production/variables.tfvars.json +++ b/terraform/application/config/production/variables.tfvars.json @@ -1,6 +1,11 @@ { "app_environment": "production", "app_replicas": 2, + "azure_maintenance_window": { + "day_of_week": 0, + "start_hour": 2, + "start_minute": 0 + }, "cluster": "production", "dqt_api_url": "https://teacher-qualifications-api.education.gov.uk", "enable_logit": true, diff --git a/terraform/application/databases.tf b/terraform/application/databases.tf index 21f8edf530..6fee24b6f2 100644 --- a/terraform/application/databases.tf +++ b/terraform/application/databases.tf @@ -29,4 +29,6 @@ module "postgres" { use_azure = var.deploy_azure_backing_services azure_enable_monitoring = var.enable_monitoring azure_extensions = ["pg_stat_statements", "pgcrypto"] + + azure_maintenance_window = var.azure_maintenance_window } diff --git a/terraform/application/variables.tf b/terraform/application/variables.tf index 9880a5175f..61414962b9 100644 --- a/terraform/application/variables.tf +++ b/terraform/application/variables.tf @@ -17,6 +17,15 @@ variable "azure_resource_prefix" { type = string } +variable "azure_maintenance_window" { + type = object({ + day_of_week = number + start_hour = number + start_minute = number + }) + default = null +} + variable "azure_sp_credentials_json" { type = string default = null