From 29e1625f49b8e9adec4534b86ba155623760bbaa Mon Sep 17 00:00:00 2001 From: Steven Miller Date: Mon, 15 Jul 2019 16:53:23 +0000 Subject: [PATCH] productionalizing the terraform code --- bastion.tf | 8 +++----- buckets.tf | 1 + db.tf | 1 + examples/from_scratch/main.tf | 1 + main.tf | 18 ++++++++++++++--- network.tf | 12 ++++++++---- node_pools.tf | 37 ++++++++++++++++++----------------- outputs.tf | 24 +++++++++++++++++------ variables.tf | 6 ++++++ 9 files changed, 72 insertions(+), 36 deletions(-) diff --git a/bastion.tf b/bastion.tf index 5800be9..a3e096b 100644 --- a/bastion.tf +++ b/bastion.tf @@ -6,6 +6,9 @@ data "google_compute_image" "ubuntu_lts_latest_image" { # Bastion host resource "google_compute_instance" "bastion" { + + count = var.management_endpoint == "public" ? 0 : 1 + name = local.bastion_name machine_type = var.machine_type_bastion zone = local.zone @@ -25,11 +28,6 @@ resource "google_compute_instance" "bastion" { enable-oslogin = "true" } - service_account { - email = "${google_service_account.bastion.email}" - scopes = [] - } - allow_stopping_for_update = true metadata_startup_script = <