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

Load Balancer module #261

Merged
merged 25 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 9 additions & 5 deletions .github/workflows/master-100-tf14.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
#
Expand All @@ -16,6 +16,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
foundations:
Expand All @@ -40,7 +41,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down Expand Up @@ -117,15 +118,18 @@ jobs:
"networking/domain_name_registrations/100-register-domain-default_domain_registrar_dns",
"networking/front_door/100-simple-front_door",
"networking/front_door/101-front_door_waf",
"networking/ip_group/100-simple-ip_group",
"networking/ip_group/101-firewall-ip_group",
"networking/load_balancers/100-simple-load-balancer-basic-sku",
"networking/load_balancers/101-load-balancer-with-rules",
"networking/load_balancers/102-internal-load-balancer",
"networking/private_dns/100-private-dns-vnet-links",
"networking/private_links/endpoints/centralized",
"networking/virtual_network_gateway/103-vpn-site-to-site-connection",
"networking/virtual_network/100-subnet-delegation",
"networking/virtual_network/101-vnet-peering-nsg",
"networking/virtual_wan/100-vwan-multi-hubs",
"networking/virtual_wan/101-vwan-multi-hubs-firewalls",
"networking/ip_group/100-simple-ip_group",
"networking/ip_group/101-firewall-ip_group",
"postgresql_server/100-simple-postgresql",
"postgresql_server/101-vnet-rule-postgresql",
"postgresql_server/102-private-endpoint-postgresql",
Expand Down Expand Up @@ -198,7 +202,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/master-100-tf15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
foundations:
Expand All @@ -40,7 +41,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down Expand Up @@ -117,15 +118,18 @@ jobs:
"networking/domain_name_registrations/100-register-domain-default_domain_registrar_dns",
"networking/front_door/100-simple-front_door",
"networking/front_door/101-front_door_waf",
"networking/ip_group/100-simple-ip_group",
"networking/ip_group/101-firewall-ip_group",
"networking/load_balancers/100-simple-load-balancer-basic-sku",
"networking/load_balancers/101-load-balancer-with-rules",
"networking/load_balancers/102-internal-load-balancer",
"networking/private_dns/100-private-dns-vnet-links",
"networking/private_links/endpoints/centralized",
"networking/virtual_network_gateway/103-vpn-site-to-site-connection",
"networking/virtual_network/100-subnet-delegation",
"networking/virtual_network/101-vnet-peering-nsg",
"networking/virtual_wan/100-vwan-multi-hubs",
"networking/virtual_wan/101-vwan-multi-hubs-firewalls",
"networking/ip_group/100-simple-ip_group",
"networking/ip_group/101-firewall-ip_group",
"postgresql_server/100-simple-postgresql",
"postgresql_server/101-vnet-rule-postgresql",
"postgresql_server/102-private-endpoint-postgresql",
Expand Down Expand Up @@ -198,7 +202,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/master-100.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
foundations:
Expand All @@ -47,7 +48,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down Expand Up @@ -124,15 +125,18 @@ jobs:
"networking/domain_name_registrations/100-register-domain-default_domain_registrar_dns",
"networking/front_door/100-simple-front_door",
"networking/front_door/101-front_door_waf",
"networking/ip_group/100-simple-ip_group",
"networking/ip_group/101-firewall-ip_group",
"networking/load_balancers/100-simple-load-balancer-basic-sku",
"networking/load_balancers/101-load-balancer-with-rules",
"networking/load_balancers/102-internal-load-balancer",
"networking/private_dns/100-private-dns-vnet-links",
"networking/private_links/endpoints/centralized",
"networking/virtual_network_gateway/103-vpn-site-to-site-connection",
"networking/virtual_network/100-subnet-delegation",
"networking/virtual_network/101-vnet-peering-nsg",
"networking/virtual_wan/100-vwan-multi-hubs",
"networking/virtual_wan/101-vwan-multi-hubs-firewalls",
"networking/ip_group/100-simple-ip_group",
"networking/ip_group/101-firewall-ip_group",
"postgresql_server/100-simple-postgresql",
"postgresql_server/101-vnet-rule-postgresql",
"postgresql_server/102-private-endpoint-postgresql",
Expand Down Expand Up @@ -205,7 +209,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/master-sql-mi-tf14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
foundations:
Expand All @@ -40,7 +41,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/master-sql-mi-tf15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
foundations:
Expand All @@ -40,7 +41,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/master-sql-mi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
foundations:
Expand All @@ -46,7 +47,7 @@ jobs:
with:
repository: Azure/caf-terraform-landingzones
path: public
ref: '2012.1.0'
ref: '2101.0.0'

- name: Login azure
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/master-standalone-tf14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
examples:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/master-standalone-tf15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
examples:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/master-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
name: standalone-scenario

on:

pull_request:
paths-ignore:
- .github/workflows/master-100.yaml
Expand All @@ -24,6 +23,7 @@ env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ROVER_RUNNER: true

jobs:
examples:
Expand Down Expand Up @@ -76,6 +76,8 @@ jobs:
"networking/firewall/100-simple-firewall-with-routes",
"networking/front_door/100-simple-front_door",
"networking/front_door/101-front_door_waf",
"networking/load_balancers/100-simple-load-balancer-basic-sku",
"networking/load_balancers/101-load-balancer-with-rules",
"networking/private_dns/100-private-dns-vnet-links",
"networking/private_links/endpoints/centralized",
"networking/virtual_network_gateway/101-vpn-site-to-site",
Expand All @@ -102,6 +104,8 @@ jobs:
"webapps/appservice/102-appservice-slots",
"webapps/appservice/103-appservice-extend",
"webapps/appservice/104-appservice-appinsight",
"networking/load_balancers/100-simple-load-balancer-basic-sku",
"networking/load_balancers/101-load-balancer-with-rules",
"webapps/appservice/105-appservice-backup"
# "mssql_mi/200-mi",
]
Expand Down
34 changes: 17 additions & 17 deletions application_gateways.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ module "application_gateways" {
source = "./modules/networking/application_gateway"
for_each = local.networking.application_gateways

global_settings = local.global_settings
client_config = local.client_config
diagnostics = local.combined_diagnostics
resource_group_name = module.resource_groups[each.value.resource_group_key].name
location = lookup(each.value, "region", null) == null ? module.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
settings = each.value
sku_name = each.value.sku_name
sku_tier = each.value.sku_tier
vnets = local.combined_objects_networking
base_tags = try(local.global_settings.inherit_tags, false) ? module.resource_groups[each.value.resource_group_key].tags : {}
private_dns = lookup(each.value, "private_dns_records", null) == null ? {} : local.combined_objects_private_dns
public_ip_addresses = local.combined_objects_public_ip_addresses
app_services = local.combined_objects_app_services
managed_identities = local.combined_objects_managed_identities
keyvaults = local.combined_objects_keyvaults
dns_zones = local.combined_objects_dns_zones
keyvault_certificates = module.keyvault_certificates
global_settings = local.global_settings
client_config = local.client_config
diagnostics = local.combined_diagnostics
resource_group_name = module.resource_groups[each.value.resource_group_key].name
location = lookup(each.value, "region", null) == null ? module.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
settings = each.value
sku_name = each.value.sku_name
sku_tier = each.value.sku_tier
vnets = local.combined_objects_networking
base_tags = try(local.global_settings.inherit_tags, false) ? module.resource_groups[each.value.resource_group_key].tags : {}
private_dns = lookup(each.value, "private_dns_records", null) == null ? {} : local.combined_objects_private_dns
public_ip_addresses = local.combined_objects_public_ip_addresses
app_services = local.combined_objects_app_services
managed_identities = local.combined_objects_managed_identities
keyvaults = local.combined_objects_keyvaults
dns_zones = local.combined_objects_dns_zones
keyvault_certificates = module.keyvault_certificates
keyvault_certificate_requests = module.keyvault_certificate_requests
application_gateway_applications = {
for key, value in local.networking.application_gateway_applications : key => value
Expand Down
4 changes: 2 additions & 2 deletions bastion_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ resource "azurecaf_name" "host" {
resource "azurerm_bastion_host" "host" {
for_each = try(local.compute.bastion_hosts, {})

name = azurecaf_name.host[each.key].result
location = lookup(each.value, "region", null) == null ? module.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
name = azurecaf_name.host[each.key].result
location = lookup(each.value, "region", null) == null ? module.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
resource_group_name = module.resource_groups[each.value.resource_group_key].name
tags = try(local.global_settings.inherit_tags, false) ? merge(module.resource_groups[each.value.resource_group_key].tags, try(each.value.tags, null)) : try(each.value.tags, null)

Expand Down
4 changes: 2 additions & 2 deletions examples/azure_ad/201-groups-and-roles/configuration.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ azuread_apps = {
application_name = "app1"
app_role_assignment_required = true
keyvaults = {
test_client = {
test_kv= {
secret_prefix = "app1"
}
}
Expand All @@ -44,7 +44,7 @@ azuread_apps = {
application_name = "app2"
app_role_assignment_required = true
keyvaults = {
test_client = {
test_kv = {
secret_prefix = "app2"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "caf" {
source = "../../../../../caf"
source = "../../../../"
global_settings = var.global_settings
tags = var.tags
resource_groups = var.resource_groups
Expand Down
2 changes: 1 addition & 1 deletion examples/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ module "caf" {
azurerm_firewall_network_rule_collection_definition = var.azurerm_firewall_network_rule_collection_definition
azurerm_firewall_application_rule_collection_definition = var.azurerm_firewall_application_rule_collection_definition
azurerm_firewall_nat_rule_collection_definition = var.azurerm_firewall_nat_rule_collection_definition
load_balancers = var.load_balancers
ip_groups = var.ip_groups

}
database = {
azurerm_redis_caches = var.azurerm_redis_caches
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
global_settings = {
default_region = "region1"
regions = {
region1 = "southeastasia"
}
}

resource_groups = {
lb = {
name = "example-lb"
}
}


public_ip_addresses = {
lb_pip = {
name = "lb_pip1"
resource_group_key = "lb"
sku = "Basic"
# Note: For UltraPerformance ExpressRoute Virtual Network gateway, the associated Public IP needs to be sku "Basic" not "Standard"
allocation_method = "Dynamic"
# allocation method needs to be Dynamic
ip_version = "IPv4"
idle_timeout_in_minutes = "4"
}
}

# Public Load Balancer will be created. For Internal/Private Load Balancer config, please refer 102-internal-load-balancer example.

load_balancers = {
lb1 = {
name = "lb-test"
sku = "basic"
resource_group_key = "lb"
backend_address_pool_name = "web-app"
frontend_ip_configurations = {
config1 = {
name = "config1"
public_ip_address_key = "lb_pip"
}
}
}
}

Loading