From 52d5bd9a9253ffe62e380773f5ce128e45f21d49 Mon Sep 17 00:00:00 2001 From: Amy Brown Date: Wed, 25 Sep 2019 16:39:36 -0500 Subject: [PATCH] slight adjustment Since internal production mode is the only mode with a scaling issue, force primary count to 3 only when mode is set to that, otherwise accept the variable value. --- primary.tf | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/primary.tf b/primary.tf index b4e05add..04f18036 100644 --- a/primary.tf +++ b/primary.tf @@ -1,5 +1,5 @@ resource "google_compute_instance" "primary" { - count = "3" + count = "${var.install_type == "ipm" ? 3 : var.primary_count}" name = "${var.prefix}-primary-${count.index}" machine_type = "${var.primary_machine_type}" zone = "${var.zone}" diff --git a/variables.tf b/variables.tf index 0a35f111..18f6350b 100644 --- a/variables.tf +++ b/variables.tf @@ -167,7 +167,7 @@ variable "image_family" { variable "primary_count" { type = "string" - description = "Currently unused. Must have 3 primary nodes." + description = "Number of primary nodes to run, must be odd number - 3 or 5 recommended." default = "3" }