From 0701143b5ac09a0f2465e31ad84844ce2d82bea0 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 | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 85dc9fc..8371741 100644 --- a/main.tf +++ b/main.tf @@ -46,7 +46,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"] session_affinity = var.session_affinity dynamic "backend" { for_each = var.backends @@ -128,4 +128,3 @@ resource "google_compute_firewall" "default-hc" { target_tags = var.target_tags target_service_accounts = var.target_service_accounts } -