From d34e83c6ecfbf7625ca4f50f9a3d703a8fd39e9a Mon Sep 17 00:00:00 2001 From: Gal Birkman <62448908+galbirk@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:02:36 +0300 Subject: [PATCH] feat: Enable db_parameter_group_name per instance (#410) --- examples/postgresql/main.tf | 5 +++-- main.tf | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/postgresql/main.tf b/examples/postgresql/main.tf index 0974f17..5cf2d69 100644 --- a/examples/postgresql/main.tf +++ b/examples/postgresql/main.tf @@ -32,8 +32,9 @@ module "aurora" { storage_type = "aurora-iopt1" instances = { 1 = { - instance_class = "db.r5.2xlarge" - publicly_accessible = true + instance_class = "db.r5.2xlarge" + publicly_accessible = true + db_parameter_group_name = "default.aurora-postgresql14" } 2 = { identifier = "static-member-1" diff --git a/main.tf b/main.tf index af5e50f..8e617c3 100644 --- a/main.tf +++ b/main.tf @@ -162,7 +162,7 @@ resource "aws_rds_cluster_instance" "this" { ca_cert_identifier = var.ca_cert_identifier cluster_identifier = aws_rds_cluster.this[0].id copy_tags_to_snapshot = try(each.value.copy_tags_to_snapshot, var.copy_tags_to_snapshot) - db_parameter_group_name = var.create_db_parameter_group ? aws_db_parameter_group.this[0].id : var.db_parameter_group_name + db_parameter_group_name = var.create_db_parameter_group ? aws_db_parameter_group.this[0].id : try(each.value.db_parameter_group_name, var.db_parameter_group_name) db_subnet_group_name = local.db_subnet_group_name engine = var.engine engine_version = var.engine_version