Commit 90a6f3f7 authored by Ankit Sharma [Microsoft]'s avatar Ankit Sharma [Microsoft]
Browse files

Merge branch 'remove_http' into 'master'

Add flag for http enabling

See merge request !443
parents f9d84d15 d02f9144
Pipeline #58488 passed with stages
in 2 minutes and 20 seconds
......@@ -108,38 +108,53 @@ resource "azurerm_application_gateway" "main" {
### Listener 1 http://mygateway.com
########
http_listener {
name = format("http-%s", local.listener_name)
frontend_ip_configuration_name = local.frontend_ip_configuration_name
frontend_port_name = format("http-%s", local.frontend_port_name)
protocol = "Http"
}
frontend_port {
name = format("http-%s", local.frontend_port_name)
port = 80
}
request_routing_rule {
name = format("http-%s", local.request_routing_rule_name)
rule_type = "Basic"
http_listener_name = format("http-%s", local.listener_name)
backend_address_pool_name = format("http-%s", local.backend_address_pool_name)
backend_http_settings_name = format("http-%s", local.backend_http_settings)
}
backend_http_settings {
name = format("http-%s", local.backend_http_settings)
cookie_based_affinity = "Disabled"
port = 80
protocol = "Http"
request_timeout = 1
}
backend_address_pool {
name = format("http-%s", local.backend_address_pool_name)
fqdns = length(var.backend_address_pool_fqdns) == 0 ? null : var.backend_address_pool_fqdns
ip_addresses = length(var.backend_address_pool_ips) == 0 ? null : var.backend_address_pool_ips
dynamic "http_listener" {
for_each = var.http_enabled ? [1] : []
content {
name = format("http-%s", local.listener_name)
frontend_ip_configuration_name = local.frontend_ip_configuration_name
frontend_port_name = format("http-%s", local.frontend_port_name)
protocol = "Http"
}
}
dynamic "frontend_port" {
for_each = var.http_enabled ? [1] : []
content {
name = format("http-%s", local.frontend_port_name)
port = 80
}
}
dynamic "request_routing_rule" {
for_each = var.http_enabled ? [1] : []
content {
name = format("http-%s", local.request_routing_rule_name)
rule_type = "Basic"
http_listener_name = format("http-%s", local.listener_name)
backend_address_pool_name = format("http-%s", local.backend_address_pool_name)
backend_http_settings_name = format("http-%s", local.backend_http_settings)
}
}
dynamic "backend_http_settings" {
for_each = var.http_enabled ? [1] : []
content {
name = format("http-%s", local.backend_http_settings)
cookie_based_affinity = "Disabled"
port = 80
protocol = "Http"
request_timeout = 1
}
}
dynamic "backend_address_pool" {
for_each = var.http_enabled ? [1] : []
content {
name = format("http-%s", local.backend_address_pool_name)
fqdns = length(var.backend_address_pool_fqdns) == 0 ? null : var.backend_address_pool_fqdns
ip_addresses = length(var.backend_address_pool_ips) == 0 ? null : var.backend_address_pool_ips
}
}
########
......
......@@ -122,7 +122,13 @@ variable "host_name" {
}
variable "gateway_zones" {
description = ""
description = "Number of Availability Zones where Application Gateway instances are deployed"
type = list(string)
default = null
}
variable "http_enabled" {
description = "A toggle for enabling or not of http listener"
type = bool
default = true
}
......@@ -334,6 +334,7 @@ module "appgateway" {
resource_tags = var.resource_tags
min_capacity = var.appgw_min_capacity
max_capacity = var.appgw_max_capacity
http_enabled = true
depends_on = [azurerm_key_vault_certificate.default]
}
......@@ -361,6 +362,7 @@ module "istio_appgateway" {
resource_tags = var.resource_tags
min_capacity = var.appgw_min_capacity
max_capacity = var.appgw_max_capacity
http_enabled = false
host_name = var.aks_dns_host
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment