Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
885edc2
Added new module Application-gateway
Jun 19, 2025
ec0eedf
edited main.tf and locals.tf
Jun 19, 2025
67839a9
removed subnets from networking.tf
Jun 19, 2025
efe4541
updated _locals.tf
Jun 19, 2025
bbd1eb4
updated _locals
Jun 19, 2025
291a572
updated variables_resources
Jun 19, 2025
20a1850
added dynamic gateway
Jun 19, 2025
a916016
changed locals
Jun 19, 2025
74f01e6
updated main.tf
Jun 19, 2025
2c473e6
updated tags
Jun 19, 2025
bbc4f60
edited variables
Jun 19, 2025
931204f
fixed locals.tf
Jun 19, 2025
786a3d4
updated locals
Jun 19, 2025
e8d4878
removed app-gateway
Jun 20, 2025
e1c3ae2
reversed app-gateway
Jun 20, 2025
22d6608
added azure_diagnostics
Jun 20, 2025
fb894d4
updated files
Jun 20, 2025
e26fc42
added dynamic grep
Jun 20, 2025
835dd33
edited variables
Jun 20, 2025
5d4763e
edited main.tf
Jun 20, 2025
fcb4ac9
typo
Jun 20, 2025
fbc9681
typo
Jun 20, 2025
1e650bb
typo
Jun 20, 2025
ffbb125
edited variables, created diagnostic.tf
Jun 20, 2025
6ac9d2f
updated main.tf
Jun 20, 2025
f7004f2
updated diagnostic.tf
Jun 20, 2025
5fda5d3
updated variables.tf
Jun 20, 2025
d629b7b
edited variables
Jun 20, 2025
a89114d
updated main.tf
Jun 20, 2025
57ee119
updated var.resources
Jun 20, 2025
11080bd
edited _variables
Jun 20, 2025
814ba80
updated variables
Jun 20, 2025
cfc6c43
updated variable
Jun 20, 2025
fb9515f
typos
Jun 20, 2025
e9b40fd
Updated variables
Jun 20, 2025
b3292fc
typos
Jun 20, 2025
ea98029
changes on variables
Jun 20, 2025
e2e3227
updated main.tf
Jun 20, 2025
ef6d9cf
major update of main and variables
Jun 20, 2025
288f0a8
updated main
Jun 20, 2025
f7e3800
updated for each
Jun 20, 2025
bebd360
updated main.tf
Jun 20, 2025
281257b
update
Jun 20, 2025
6e0d5ae
updated variables
Jun 20, 2025
69f72e8
edited variables
Jun 20, 2025
c554c11
updated locals
Jun 20, 2025
44767b5
updated diagnostic.tf
Jun 20, 2025
b937c5c
typo
Jun 20, 2025
7b91c7a
updated main.tf
Jun 20, 2025
e96c455
updated main
Jun 20, 2025
e89f71d
updated main
Jun 20, 2025
f7435ed
updated main
Jun 20, 2025
f5505c1
main update
Jun 20, 2025
2ca72da
udapted main
Jun 20, 2025
747f5b1
removed retention policy
Jun 20, 2025
a2afc02
updated outputs
Jun 20, 2025
c1297b5
updated main
Jun 20, 2025
cc7eb54
updated variables
Jun 20, 2025
b9794f2
typo
Jun 20, 2025
124c0ef
updated locals
Jun 20, 2025
ff22172
update on main
Jun 20, 2025
7079525
updated vars
Jun 20, 2025
51b82d6
push diagnostic.tf
Jun 20, 2025
652c772
small typo
Jun 20, 2025
5837d49
minor output update
Jun 20, 2025
ae0dfa1
updated main.tf
Jun 20, 2025
e23e45e
small typo
Jun 20, 2025
135bf0b
added value
Jun 20, 2025
9d649fd
added network_rule_set to container registry module
Jun 23, 2025
1cd74b5
added keyvault_client_password and secret
Jun 23, 2025
0f16a75
added data.tf and locals.tf
Jun 23, 2025
bbbc15c
updated object_id
Jun 23, 2025
58438e3
fix
lyudmililchev92 Jun 23, 2025
19a4568
fix
lyudmililchev92 Jun 23, 2025
47b85ca
fix
lyudmililchev92 Jun 23, 2025
8283b4f
revert
lyudmililchev92 Jun 23, 2025
aa63961
fix
lyudmililchev92 Jun 23, 2025
d87b6b3
fix
lyudmililchev92 Jun 23, 2025
d89a0c1
added by user
Jun 23, 2025
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
7 changes: 7 additions & 0 deletions src/_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ variable "global_settings" {
}
}

variable "application_gateways" {
type = any
description = "Map of Application Gateways to deploy"
default = {}
}


Comment thread
KirilKirilov966 marked this conversation as resolved.
Outdated
variable "landingzone" {
description = "Landing zone metadata and tfstate dependencies"
type = object({
Expand Down
20 changes: 20 additions & 0 deletions src/modules/_networking/application_gateway/_locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
locals {
lz_key = try(var.settings.lz_key, var.client_config.landingzone_key)

resource_group = var.resources[local.lz_key].resource_groups[var.settings.resource_group_ref]

resource_group_name = local.resource_group.name
location = local.resource_group.location

public_ip = var.resources[local.lz_key].public_ips[var.settings.public_ip]

subnet = var.resources[local.lz_key].virtual_networks[var.settings.virtual_network].subnets[
split("/", var.settings.subnet_ref)[1]
]
Comment thread
KirilKirilov966 marked this conversation as resolved.
Outdated

tags = merge(
var.global_settings.tags,
var.global_settings.inherit_resource_group_tags ? local.resource_group.tags : {},
try(var.settings.tags, {})
)
}
80 changes: 80 additions & 0 deletions src/modules/_networking/application_gateway/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
resource "azurerm_application_gateway" "main" {
name = var.settings.name
location = local.location
resource_group_name = local.resource_group_name
tags = local.tags

sku {
name = var.settings.sku.name
tier = var.settings.sku.tier
capacity = var.settings.sku.capacity
}

gateway_ip_configuration {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need one or more

name = var.settings.gateway_ip_configuration.name
subnet_id = local.subnet.id
}

frontend_ip_configuration {
Comment thread
KirilKirilov966 marked this conversation as resolved.
Outdated
name = var.settings.frontend_ip_configuration.name
public_ip_address_id = local.public_ip.id
}

dynamic "frontend_port" {
for_each = try(var.settings.frontend_ports, [])
content {
name = frontend_port.value.name
port = frontend_port.value.port
}
}

dynamic "backend_address_pool" {
for_each = try(var.settings.backend_address_pools, [])
content {
name = backend_address_pool.value.name
ip_addresses = try(backend_address_pool.value.ip_addresses, [])
}
}

dynamic "backend_http_settings" {
for_each = try(var.settings.backend_http_settings_list, [])
content {
name = backend_http_settings.value.name
port = backend_http_settings.value.port
protocol = backend_http_settings.value.protocol
cookie_based_affinity = try(backend_http_settings.value.cookie_based_affinity, "Disabled")
request_timeout = try(backend_http_settings.value.request_timeout, 20)
}
}

dynamic "http_listener" {
for_each = try(var.settings.http_listeners, [])
content {
name = http_listener.value.name
frontend_ip_configuration_name = http_listener.value.frontend_ip_configuration_name
frontend_port_name = http_listener.value.frontend_port_name
protocol = http_listener.value.protocol
host_name = try(http_listener.value.host_name, null)
}
}

dynamic "request_routing_rule" {
for_each = try(var.settings.request_routing_rules, [])
content {
name = request_routing_rule.value.name
rule_type = request_routing_rule.value.rule_type
http_listener_name = request_routing_rule.value.http_listener_name
backend_address_pool_name = request_routing_rule.value.backend_address_pool_name
backend_http_settings_name = request_routing_rule.value.backend_http_settings_name
}
}

dynamic "timeouts" {
for_each = can(var.settings.timeouts) ? [1] : []
content {
create = try(var.settings.timeouts.create, null)
update = try(var.settings.timeouts.update, null)
delete = try(var.settings.timeouts.delete, null)
}
}
}
7 changes: 7 additions & 0 deletions src/modules/_networking/application_gateway/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "name" {
value = azurerm_application_gateway.main.name
}

output "id" {
value = azurerm_application_gateway.main.id
}
19 changes: 19 additions & 0 deletions src/modules/_networking/application_gateway/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
variable "settings" {
type = any
}

variable "resources" {
type = any
description = "Resources provided by other modules"
default = {}
}

variable "global_settings" {
type = any
description = "Global settings shared across modules"
}

variable "client_config" {
type = any
description = "Client config object (landingzone key, etc.)"
}
25 changes: 25 additions & 0 deletions src/networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,31 @@ module "virtual_network_gateways" {
landingzone_key = var.landingzone.key
}
}
module "application_gateways" {
source = "./modules/_networking/application_gateway"
for_each = var.application_gateways

settings = each.value
global_settings = local.global_settings

resources = merge(
{
(var.landingzone.key) = {
resource_groups = module.resource_groups
virtual_networks = module.virtual_networks
public_ips = module.public_ips
}
},
{
for k, v in module.remote_states : k => v.outputs
}
)

client_config = {
landingzone_key = var.landingzone.key
}
}


module "public_ips" {
source = "./modules/_networking/public_ip"
Expand Down
Loading