Skip to content

Commit

Permalink
Merge pull request #2 from DNXLabs/add-aurora
Browse files Browse the repository at this point in the history
adding variable for specify number of aurora instances on the cluster
  • Loading branch information
maiconrocha authored Jun 4, 2021
2 parents 6135af7 + ff0f35b commit a310217
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion aurora.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a310217

Please sign in to comment.