From 66991bfcdd698d031520d82065f9a9403458ce96 Mon Sep 17 00:00:00 2001 From: tom-ogle-moj <142220790+tom-ogle-moj@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:52:49 +0000 Subject: [PATCH] DPR2-1435: Make postgres_settings configuration block conditional on the engine type being postgres. (#8822) This avoids the terraform plan being polluted with changes to postgres settings for oracle sources that need reapplying on every terraform run. --- .../modules/dms_s3_v2/main.tf | 12 ++++++++---- .../modules/dms_s3_v2/variables.tf | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/main.tf b/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/main.tf index 1a0acdf776b..52e2e62d39a 100644 --- a/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/main.tf +++ b/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/main.tf @@ -134,10 +134,14 @@ resource "aws_dms_endpoint" "dms-s3-target-source" { ssl_mode = var.source_ssl_mode username = var.source_app_username - postgres_settings { - map_boolean_as_boolean = true - heartbeat_enable = true - heartbeat_frequency = 5 + dynamic postgres_settings { + for_each = var.source_engine_name == "postgres" ? [1]: [] + + content { + map_boolean_as_boolean = true + heartbeat_enable = true + heartbeat_frequency = 5 + } } extra_connection_attributes = var.extra_attributes diff --git a/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/variables.tf b/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/variables.tf index 346d5f716d3..a27b4da5ffe 100644 --- a/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/variables.tf +++ b/terraform/environments/digital-prison-reporting/modules/dms_s3_v2/variables.tf @@ -291,7 +291,7 @@ variable "source_engine" { variable "source_engine_name" { default = "" type = string - description = "Engine name for DMS" + description = "Type of engine for the source endpoint. Example valid values are postgres, oracle" }