diff --git a/main.tf b/main.tf index 819552e..5104968 100644 --- a/main.tf +++ b/main.tf @@ -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 diff --git a/secret.tf b/secret.tf index a059798..b6c0774 100644 --- a/secret.tf +++ b/secret.tf @@ -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 }