From e56d9595a546a7a42ae5a83fc0d9f2c3cdae274b Mon Sep 17 00:00:00 2001 From: denissimonovski <37238646+denissimonovski@users.noreply.github.com> Date: Thu, 24 Jun 2021 18:54:24 +0200 Subject: [PATCH] feat: Update google_compute_region_backend_service timeout to use same timeout as var.health_check (#55) * refactor default google_compute_region_backend_service timeout_sec to a variable * Update main.tf Co-authored-by: Morgante Pell Co-authored-by: Denis Simonovski Co-authored-by: Morgante Pell --- .gitignore | 3 +++ main.tf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 477cdaf..b59baf4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ \#*\# .\#* +# JetBrains relates files +.idea + # Vim-related files [._]*.s[a-w][a-z] [._]s[a-w][a-z] diff --git a/main.tf b/main.tf index 4adb824..a549ff0 100644 --- a/main.tf +++ b/main.tf @@ -48,7 +48,7 @@ resource "google_compute_region_backend_service" "default" { 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 + timeout_sec = var.health_check["timeout_sec"] == null ? 10 : var.health_check["timeout_sec"] connection_draining_timeout_sec = var.connection_draining_timeout_sec session_affinity = var.session_affinity dynamic "backend" {