From 80feaa94b33b34fe4252b2613685f7a54f2e1bae Mon Sep 17 00:00:00 2001 From: Florian Wiegand Date: Fri, 16 Apr 2021 10:01:27 +0200 Subject: [PATCH 1/2] Don't use instance_type_replica for main replica --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index dc032a6..ccab0b9 100644 --- a/main.tf +++ b/main.tf @@ -116,7 +116,7 @@ resource "aws_rds_cluster_instance" "this" { cluster_identifier = element(concat(aws_rds_cluster.this.*.id, [""]), 0) engine = var.engine engine_version = var.engine_version - instance_class = try(lookup(var.instances_parameters[count.index], "instance_type"), coalesce(var.instance_type_replica, var.instance_type)) + instance_class = try(lookup(var.instances_parameters[count.index], "instance_type"), count.index > 0 ? coalesce(var.instance_type_replica, var.instance_type) : var.instance_type) publicly_accessible = try(lookup(var.instances_parameters[count.index], "publicly_accessible"), var.publicly_accessible) db_subnet_group_name = local.db_subnet_group_name db_parameter_group_name = var.db_parameter_group_name From c5fcc87b0ec32030f9a8555d1106990cd9fae9bb Mon Sep 17 00:00:00 2001 From: Florian Wiegand Date: Fri, 16 Apr 2021 10:01:27 +0200 Subject: [PATCH 2/2] fix: do not use instance_type_replica for main replica --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index dc032a6..ccab0b9 100644 --- a/main.tf +++ b/main.tf @@ -116,7 +116,7 @@ resource "aws_rds_cluster_instance" "this" { cluster_identifier = element(concat(aws_rds_cluster.this.*.id, [""]), 0) engine = var.engine engine_version = var.engine_version - instance_class = try(lookup(var.instances_parameters[count.index], "instance_type"), coalesce(var.instance_type_replica, var.instance_type)) + instance_class = try(lookup(var.instances_parameters[count.index], "instance_type"), count.index > 0 ? coalesce(var.instance_type_replica, var.instance_type) : var.instance_type) publicly_accessible = try(lookup(var.instances_parameters[count.index], "publicly_accessible"), var.publicly_accessible) db_subnet_group_name = local.db_subnet_group_name db_parameter_group_name = var.db_parameter_group_name