From fab4e09ba54838da2bce155b35e6aa5f2ecf9be1 Mon Sep 17 00:00:00 2001 From: Andrew Strozyk Date: Tue, 26 Jan 2021 14:33:41 -0600 Subject: [PATCH 1/3] adding connection_draining_timeout_sec variable to the google_compute_region_backend_service --- main.tf | 13 +++++++------ variables.tf | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index 89518d6..7343eb8 100644 --- a/main.tf +++ b/main.tf @@ -44,12 +44,13 @@ resource "google_compute_forwarding_rule" "default" { } resource "google_compute_region_backend_service" "default" { - project = var.project - name = var.health_check["type"] == "tcp" ? "${var.name}-with-tcp-hc" : "${var.name}-with-http-hc" - region = var.region - protocol = var.ip_protocol - timeout_sec = 10 - session_affinity = var.session_affinity + project = var.project + name = var.health_check["type"] == "tcp" ? "${var.name}-with-tcp-hc" : "${var.name}-with-http-hc" + region = var.region + protocol = var.ip_protocol + timeout_sec = 10 + connection_draining_timeout_sec = var.connection_draining_timeout_sec + session_affinity = var.session_affinity dynamic "backend" { for_each = var.backends content { diff --git a/variables.tf b/variables.tf index c068b72..ed8258b 100644 --- a/variables.tf +++ b/variables.tf @@ -132,3 +132,7 @@ variable "service_label" { type = string } +variable "connection_draining_timeout_sec" { + description = "Time for which instance will be drained" + default = "0" + type = number From 9e36b7f31b55feb12712d0bc722c1a0538a4693d Mon Sep 17 00:00:00 2001 From: Andrew Strozyk Date: Tue, 26 Jan 2021 14:38:09 -0600 Subject: [PATCH 2/3] fixing missing bracket --- variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/variables.tf b/variables.tf index ed8258b..9c3b8d5 100644 --- a/variables.tf +++ b/variables.tf @@ -136,3 +136,4 @@ variable "connection_draining_timeout_sec" { description = "Time for which instance will be drained" default = "0" type = number +} From c20f42a71079fc04e655f7cb6cc2c32d57f2dc8a Mon Sep 17 00:00:00 2001 From: Andrew Strozyk Date: Wed, 27 Jan 2021 11:16:02 -0600 Subject: [PATCH 3/3] updating the variable default to 'null' --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 9c3b8d5..f85bd18 100644 --- a/variables.tf +++ b/variables.tf @@ -134,6 +134,6 @@ variable "service_label" { variable "connection_draining_timeout_sec" { description = "Time for which instance will be drained" - default = "0" + default = null type = number }