diff --git a/_variables.tf b/_variables.tf index 2bca6d0..2d0ceff 100644 --- a/_variables.tf +++ b/_variables.tf @@ -132,3 +132,9 @@ variable "preferred_backup_window" { type = string default = "07:00-09:00" } + +variable "count_aurora_instances" { + description = "Number of Aurora Instances" + type = number + default = "1" +} diff --git a/aurora.tf b/aurora.tf index 6f8630f..651fe66 100644 --- a/aurora.tf +++ b/aurora.tf @@ -15,7 +15,7 @@ resource "aws_rds_cluster" "aurora_cluster" { } resource "aws_rds_cluster_instance" "cluster_instances" { - count = var.db_type == "aurora" ? 2 : 0 + count = var.db_type == "aurora" ? var.count_aurora_instances : 0 identifier = "${var.identifier}-${count.index}" cluster_identifier = aws_rds_cluster.aurora_cluster[0].id instance_class = var.instance_class