From cd839eacdaae9bc49adac281bfd6efd45c472e21 Mon Sep 17 00:00:00 2001 From: koladeadewuyi-moj <136330532+koladeadewuyi-moj@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:42:42 +0100 Subject: [PATCH] DPR2-709: Set maintenance window to Sun at 2am for CDC jobs (#7606) --- .../modules/domains/ingestion-jobs/glue.tf | 1 + .../modules/domains/ingestion-jobs/variables.tf | 5 +++++ .../digital-prison-reporting/modules/glue_job/main.tf | 1 + .../digital-prison-reporting/modules/glue_job/variables.tf | 6 ++++++ 4 files changed, 13 insertions(+) diff --git a/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/glue.tf b/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/glue.tf index f305be1d309..0884df80829 100644 --- a/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/glue.tf +++ b/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/glue.tf @@ -21,6 +21,7 @@ module "glue_reporting_hub_cdc_job" { worker_type = var.glue_cdc_job_worker_type number_of_workers = var.glue_cdc_job_num_workers max_concurrent = var.glue_cdc_max_concurrent + maintenance_window = var.glue_cdc_maintenance_window region = var.account_region account = var.account_id log_group_retention_in_days = var.glue_log_group_retention_in_days diff --git a/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/variables.tf b/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/variables.tf index 5253b24fc6f..29bc628f0c6 100644 --- a/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/variables.tf +++ b/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs/variables.tf @@ -267,6 +267,11 @@ variable "glue_cdc_max_concurrent" { description = "(Optional) The maximum number of concurrent runs allowed for a job." } +variable "glue_cdc_maintenance_window" { + type = string + description = "The maintenance window during which the glue job will be restarted" +} + variable "glue_cdc_create_role" { type = bool default = false diff --git a/terraform/environments/digital-prison-reporting/modules/glue_job/main.tf b/terraform/environments/digital-prison-reporting/modules/glue_job/main.tf index b5e9edfbe48..c78e0e9a639 100644 --- a/terraform/environments/digital-prison-reporting/modules/glue_job/main.tf +++ b/terraform/environments/digital-prison-reporting/modules/glue_job/main.tf @@ -35,6 +35,7 @@ resource "aws_glue_job" "glue_job" { worker_type = var.worker_type number_of_workers = var.number_of_workers execution_class = var.execution_class + maintenance_window = var.maintenance_window tags = local.tags command { diff --git a/terraform/environments/digital-prison-reporting/modules/glue_job/variables.tf b/terraform/environments/digital-prison-reporting/modules/glue_job/variables.tf index aee3bc83b51..d1950cd5c62 100644 --- a/terraform/environments/digital-prison-reporting/modules/glue_job/variables.tf +++ b/terraform/environments/digital-prison-reporting/modules/glue_job/variables.tf @@ -198,6 +198,12 @@ variable "number_of_workers" { description = "(Optional) The number of workers of a defined workerType that are allocated when a job runs." } +variable "maintenance_window" { + type = string + default = null + description = "(Optional) The maintenance window during which the glue job will be restarted" +} + variable "security_configuration" { type = string