Skip to content

Commit

Permalink
Merge pull request #11 from ehenrik/fix-1
Browse files Browse the repository at this point in the history
fix: reader_instance_type ternary
  • Loading branch information
argoyle authored Jun 15, 2022
2 parents 81e0d5e + 02a9726 commit 95c473a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ resource "aws_rds_cluster_instance" "writer" {


resource "aws_rds_cluster_instance" "reader" {
count = var.reader_instance_type ? 0 : 1
count = var.reader_instance_type == null ? 0 : 1
cluster_identifier = aws_rds_cluster.default.cluster_identifier
identifier = "${var.identifier}-reader"
instance_class = var.reader_instance_type
Expand Down
2 changes: 1 addition & 1 deletion secret.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ locals {
DB_HOST = aws_rds_cluster.default.endpoint
DB_READER_HOST = local.reader_instance_endpoint
}
reader_instance_endpoint = var.reader_instance_type ? "" : aws_rds_cluster_instance.reader[0].endpoint
reader_instance_endpoint = var.reader_instance_type == null ? "" : aws_rds_cluster_instance.reader[0].endpoint
password = random_password.password.result
}

Expand Down

0 comments on commit 95c473a

Please sign in to comment.