Skip to content

Commit

Permalink
added pick_host_name_from_backend_http_settings and host_name
Browse files Browse the repository at this point in the history
  • Loading branch information
balpurewal committed Oct 11, 2024
1 parent 0e4ae59 commit 962f7cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion azurerm/modules/azurerm-app-gateway/app_gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ resource "azurerm_application_gateway" "network" {

probe {
name = "k8s-probe"
host = "127.0.0.1"
host = var.pick_host_name_from_backend_http_settings ? null : "127.0.0.1"
protocol = "Http"
interval = 15
unhealthy_threshold = 4
timeout = 15
path = "/healthz"
pick_host_name_from_backend_http_settings = var.pick_host_name_from_backend_http_settings
match {
status_code = ["200"]
}
Expand All @@ -119,6 +120,7 @@ resource "azurerm_application_gateway" "network" {
protocol = "Http"
request_timeout = 10
probe_name = "k8s-probe"
host_name = var.host_name
}

request_routing_rule {
Expand Down
12 changes: 12 additions & 0 deletions azurerm/modules/azurerm-app-gateway/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,15 @@ variable "acme_email" {
type = string
description = "Email for Acme registration, must be a valid email"
}

variable "pick_host_name_from_backend_http_settings" {
type = bool
default = false
description = "Whether the host header should be picked from the backend HTTP settings. Defaults to false."
}

variable "host_name" {
type = string
default = null
description = "Host header to be sent to the backend servers. Cannot be set if pick_host_name_from_backend_address is set to true"
}

0 comments on commit 962f7cc

Please sign in to comment.