diff --git a/main.tf b/main.tf index f5213c5..d4338e6 100644 --- a/main.tf +++ b/main.tf @@ -71,7 +71,7 @@ resource "aws_rds_cluster_instance" "cluster_instance_0" { db_parameter_group_name = "${var.db_parameter_group_name}" preferred_maintenance_window = "${var.preferred_maintenance_window}" apply_immediately = "${var.apply_immediately}" - monitoring_role_arn = "${coalesce("${aws_iam_role.rds-enhanced-monitoring.arn}", "")}" + monitoring_role_arn = "${join("", aws_iam_role.rds-enhanced-monitoring.*.arn)}" monitoring_interval = "${var.monitoring_interval}" auto_minor_version_upgrade = "${var.auto_minor_version_upgrade}" promotion_tier = "0" @@ -94,8 +94,7 @@ resource "aws_rds_cluster_instance" "cluster_instance_n" { db_parameter_group_name = "${var.db_parameter_group_name}" preferred_maintenance_window = "${var.preferred_maintenance_window}" apply_immediately = "${var.apply_immediately}" - monitoring_role_arn = "${coalesce("${aws_iam_role.rds-enhanced-monitoring.arn}", "")}" - monitoring_interval = "${var.monitoring_interval}" + monitoring_role_arn = "${join("", aws_iam_role.rds-enhanced-monitoring.*.arn)}" monitoring_interval = "${var.monitoring_interval}" auto_minor_version_upgrade = "${var.auto_minor_version_upgrade}" promotion_tier = "${count.index + 1}"