Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding connection draining timeout to backend service #42

Merged
merged 3 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ variable "service_label" {
type = string
}

variable "connection_draining_timeout_sec" {
description = "Time for which instance will be drained"
default = "0"
morgante marked this conversation as resolved.
Show resolved Hide resolved
type = number
}