Terraform - Azure Verified Modules for Platform Landing Zone (ALZ)
The platform_landing_zone
starter module deploys the end to end platform landing zone using Azure Verified Modules. It is fully configurable to meet different scenarios.
This documentation covers the top scenarios and documents all available configuration settings for this module.
We aim to cover 80% of common scenarios. If the particular scenario is not covered here, it may be possible to adjust the configuration settings to match the requirements. If not, then it my be the case you need to adjust their Terraform code post bootstrap.
This documentation covers the following:
- Usage: How to use this starter module
- Scenarios: The scenarios supported with example configuration files
- Options: Common customization tasks and how to perform them are documented here
- Platform landing zone configuration file: Comprehensive documentation of the available input variables
- Azure Verified Modules Reference: A reference list and explanation of the Azure Verified Modules used in this starter module
To use the starter module, follow the detailed steps documented in phases 1, 2, and 3 of the Accelerator. Here we cover come specifics of this starter module.
There are 3 sets of configuration that can be supplied to the accelerator to pre-configure it.
The available configuration inputs are:
- Bootstrap Configuration File
- Platform Landing Zone Configuration File
- Platform Landing Zone Library (lib) Folder
This is the YAML file used to provide the base configuration required to bootstrap your version control system and Azure.
Some of this configuration is also fed into this starter module. You will see a terraform.tfvars.json
file is created to hold these inputs. They include management group ID, subscriptions IDs, starter locations, etc.
We provide examples of this file for each version control system. These can be found in the Phase 2 documentation, but are also listed here for convenience:
- Azure DevOps: inputs-azure-devops.yaml
- GitHub: inputs-github.yaml
- Local: inputs-local.yaml
This is the tfvars
file in HCL format that determines which resources are deployed and what type of hub networking connectivity is deployed.
This file is validated by the accelerator and then directly copied to your repository, so it retains the ordering, comments, etc. You will see the file is renamed to *.auto.tfvars
, so that it is automatically picked up by Terraform.
We provide examples of this file for each scenario. These can be found in the scenarios documentation.
This is a folder of configuration files used to customize the management groups and associated policies. This library and its usage is documented alongside the avm-ptn-alz
module. However, we cover a common customization use case in our How To section.
By default we supply an empty lib
folder. This folder can be overridden with a set of files to customize Management Groups and Policy Assignments. Use cases include:
- Renaming management groups
- Customizing the management group structure
- Removing policy assignments
- Adding custom policy definitions and assignments
The detailed documentation for the library and it’s usage can be found here:
- Platform Landing Zone Library Documentation: https://azure.github.io/Azure-Landing-Zones-Library/
- Azure Verified Module for Management Groups and Policy: https://registry.terraform.io/modules/Azure/avm-ptn-alz/azurerm/0.10.0
Scenarios are common use cases when deploying the platform landing zone. The following section provide a description of the scenario and link to the pre-configured files for that scenario.
The available scenarios are:
- Multi-Region Hub and Spoke Virtual Network with Azure Firewall
- Multi-Region Virtual WAN with Azure Firewall
- Multi-Region Hub and Spoke Virtual Network with Network Virtual Appliance (NVA)
- Multi-Region Virtual WAN with Network Virtual Appliance (NVA)
- Single-Region Hub and Spoke Virtual Network with Azure Firewall
- Single-Region Virtual WAN with Azure Firewall
- Management Groups, Policy and Management Resources Only
A full platform landing zone deployment with hub and spoke Virtual Network connectivity using Azure Firewall in multiple regions.
- Example Platform landing zone configuration file: full-multi-region/hub-and-spoke-vnet.tfvars
- Detailed documentation: Multi-region hub and spoke virtual network with Azure Firewall
A full platform landing zone deployment with Virtual WAN network connectivity using Azure Firewall in multiple regions.
- Example platform landing zone configuration file: full-multi-region/virtual-wan.tfvars
- Detailed documentation: Multi-region virtual wan with Azure Firewall
A full platform landing zone deployment with hub and spoke Virtual Network connectivity in multiple regions, ready for a third party Network Virtual Appliance (NVA).
- Example platform landing zone configuration file: full-multi-region-nva/virtual-wan.tfvars
- Detailed documentation: Multi-region virtual wan with Network Virtual Appliance
A full platform landing zone deployment with Virtual WAN network connectivity in multiple regions, ready for a third party Network Virtual Appliance (NVA).
- Example platform landing zone configuration file: full-multi-region-nva/virtual-wan.tfvars
- Detailed documentation: Multi-region virtual wan with Azure Firewall
A full platform landing zone deployment with hub and spoke Virtual Network connectivity using Azure Firewall in a single region.
The single region option is here for completeness, we recommend always having at least 2 regions to support resiliency.
- Example Platform landing zone configuration file: full-single-region/hub-and-spoke-vnet.tfvars
- Detailed documentation: Single-region hub and spoke virtual network with Azure Firewall
A full platform landing zone deployment with Virtual WAN network connectivity using Azure Firewall in a single region.
The single region option is here for completeness, we recommend always having at least 2 regions to support resiliency.
- Example platform landing zone configuration file: full-single-region/virtual-wan.tfvars
- Detailed documentation: Single-region virtual wan with Azure Firewall
A platform landing zone deployment without any connectivity resources.
- Example Platform landing zone configuration file: management_only/management.tfvars
- Detailed documentation: Management Only
The options section details how to make configuration changes that apply to the common scenarios.
The available options are:
- Customize Management Group Names and IDs
- Turn off DDOS protection plan
- Turn off Bastion host
- Turn off Private DNS zones and Private DNS resolver
- Turn off Virtual Network Gateways
- Additional Regions
- IP Address Ranges
You may want to customize the management groups names and IDs. In order to do this they need to supply a lib
folder to the accelerator.
The lib
folder should contain the following structure (we are showing it nested under the standard accelerator file structure here):
📂accelerator
┣ 📂config
┃ ┣ 📂lib
┃ ┃ ┗ 📂architecture_definitions
┃ ┃ ┗ 📜alz.alz_architecture_definition.json
┃ ┗ 📜inputs.yaml
┗ 📂output
Thelib
folder must be namedlib
, any other name will not work
The alz.alz_architecture_definition.json
file content should be copied from here.
You can then edit this configuration file to update the management group names and IDs.
For example to prefix all the management group display names with Contoso
and update the management group IDs to have the contoso-
prefix they can update the file to look like this:
|
|
When updating the management groupid
, you also need to consider any child management groups that refer to it by theparent_id
Now, when deploying the accelerator they need to supply their lib folder as an argument with starterAdditionalFiles
:
Deploy-Accelerator -inputs "c:\accelerator\config\inputs.yaml", "c:\accelerator\config\networking.yaml" -starterAdditionalFiles "c:\accelerator\config\lib" -output "c:\accelerator\output"
You can choose to not deploy a DDOS protection plan. In order to do that, they need to remove the DDOS protection plan configuration and disable the DINE (deploy if not exists) policy. You can either comment out or remove the configuration entirely.
DDOS Protection plan is a critical security protection for public facing services. Carefully consider this and be sure to put in place an alternative solution, such as per IP protection.
The steps to follow are:
- To keep the code tidy remove the follow settings from
custom_replacements.names
: ddos_resource_group_name
ddos_protection_plan_name
- To keep the code tidy remove the follow settings from
custom_replacements.resource_group_identifiers
: ddos_protection_plan_resource_group_id
- To keep the code tidy remove the follow settings from
custom_replacements.resource_identifiers
: ddos_protection_plan_id
- Remove the follow configuration settings from
management_group_settings.policy_default_values
: ddos_protection_plan_id
- Add the follow section to
management_group_settings.policy_assignments_to_modify
:connectivity = { policy_assignments = { Enable-DDoS-VNET = { enforcement_mode = "DoNotEnforce" } } }
- Remove the whole
ddos_protection_plan
section fromhub_and_spoke_vnet_settings
orvirtual_wan_settings
You can choose to not deploy a Bastion Host. In order to do that, they need to remove the Bastion Host configuration. You can either comment out or remove the configuration entirely.
The steps to follow are:
- To keep the code tidy remove the follow settings from
custom_replacements.names
: <region>_bastion_subnet_address_prefix
where<region>
is for each region- Remove the whole
bastion
section from eachhub_and_spoke_vnet_virtual_networks
orvirtual_wan_virtual_hubs
region
You can choose to not deploy any DNS related resources. In order to do that, they need to remove the DNS configuration and disable the DINE (deploy if not exists) policy. You can either comment out or remove the configuration entirely.
The steps to follow are:
To keep the code tidy remove the follow settings from
custom_replacements.names
:dns_resource_group_name
<region>_private_dns_resolver_subnet_address_prefix
where<region>
is for each regionRemove the follow configuration settings from
management_group_settings.policy_default_values
:private_dns_zone_subscription_id
private_dns_zone_region
private_dns_zone_resource_group_name
Add the follow section to
management_group_settings.policy_assignments_to_modify
:corp = { policy_assignments = { Deploy-Private-DNS-Zones = { enforcement_mode = "DoNotEnforce" } } }
Remove the whole
private_dns_zones
section from eachhub_and_spoke_vnet_virtual_networks
orvirtual_wan_virtual_hubs
region
You can choose to not deploy any Virtual Network Gateways. In order to do that, you need to remove the Virtual Network Gateway configuration. You can either comment out or remove the configuration entirely.
The steps to follow are:
- To keep the code tidy remove the follow settings from
custom_replacements.names
: <region>_gateway_subnet_address_prefix
where<region>
is for each region- Remove the whole
virtual_network_gateways
section from eachhub_and_spoke_vnet_virtual_networks
orvirtual_wan_virtual_hubs
region
You can also just turn off the specific Virtual Network Gateway types you don’t want to deploy.
For ExpressRoute Virtual Network Gateways:
- Remove the whole
express_route
section from thevirtual_network_gateways
section in eachhub_and_spoke_vnet_virtual_networks
orvirtual_wan_virtual_hubs
region
For VPN Virtual Network Gateways:
- Remove the whole
vpn
section from thevirtual_network_gateways
section in eachhub_and_spoke_vnet_virtual_networks
orvirtual_wan_virtual_hubs
region
Additional regions are supported. The custom can add up to 10 regions using the out of the box module.
If you need to scale beyond 10 regions, that can be accommodated by adding additional built in replacements here
To add an additional regions, the process is copy
-> paste
-> update
:
- Copy, paste and update the regional resource group names in
custom_replacements.names
- Copy, paste and update the regional IP Ranges in
custom_replacements.names
- Copy, paste and update the regional resource group in
connectivity_resource_groups
- Copy, paste and update the region in
hub_and_spoke_vnet_virtual_networks
orvirtual_wan_virtual_hubs
The example configuration files that include connectivity include an out of the box set of ip address ranges. These ranges have been chosen to support a real world scenario with optimal use to avoid ip exhaustion as you scale. However you may not want to use these ranges if they may overlap with their existing ranges or they are planning to scale beyond the /16 per region we cater for.
In order to update the IP ranges, you can update the custom_replacements.names
section that includes the IP ranges. For example if you prefer to use 172.16
or 192.168
, they could update the ranges as follows:
|
|
This section details the available configuration settings / variables in this starter module.
The custom_replacements
variable builds on the built-in replacements to provide user defined replacements that can be used throughout your configuration. This reduces the complexity of the configuration file by allowing re-use of names and other definitions that may be repeated throughout the configuration.
There are 4 layers of replacements that can be built upon to provide the level of flexibility you need. The order of precedence determines which other replacements can be used to build your replacement. For example a ‘Name’ replacement can be used to build a ‘Resource Group Identifier’ replacement, but a ‘Resource Group Identifier’ replacement cannot be used to build a ‘Name’ replacement.
The layers and precedence order is:
- Built-in Replacements: These can be found at the top of our example config files and you can also see them in the code base here
- Names: This is for resource names and other basic strings
- Resource Group Identifiers: This is for resource group IDs
- Resource Identifiers: This is for resource IDs
Used to define custom names and strings that can be used throughout the configuration file. This can leverage the built-in replacements.
Exanple usage:
|
|
Used to define resource group IDs that can be used throughout the configuration file. This can leverage the built-in replacements and custom names.
Exanple usage:
|
|
Used to define resource IDs that can be used throughout the configuration file. This can leverage the built-in replacements, custom names, and resource group IDs.
Exanple usage:
|
|
The enable_telemetry
variable determines whether telemetry about module usage is sent to Microsoft, enabling us to invest in improvements to the Accelerator and Azure Verified Modules.
Example usage:
|
|
The tags
variable is a default set of tags to apply to resources that support them. In many cases, these tags can be overriden on a per resource basis.
Example usage:
|
|
The management_resource_settings
variable is used to configure the management resources. This includes the log analytics workspace, automation account, and data collection rules for Azure Monitoring Agent (AMA).
This variable is of type any
as it maps directly to the Azure Verified Module variables. To determine what can be supplied to this variable you can refer to the documentation for this module directly:
Documentation link: registry.terraform.io/modules/Azure/avm-ptn-alz-management
Example usage:
|
|
The management_group_settings
variable is used to configure the management groups, policies, and policy role assignments.
This variable is of type any
as it maps directly to the Azure Verified Module variables. To determine what can be supplied to this variable you can refer to the documentation for this module directly:
Documentation link: registry.terraform.io/modules/Azure/avm-ptn-alz
Example usage:
|
|
The connectivity_type
variable is used to choose the type of connectivity to deploy. Supported values are:
hub_and_spoke_vnet
: Deploy hub and spoke networking using Azure Virtual Networksvirtual_wan
: Deploy Azure Virtual WAN networkingnone
: Don’t deploy any networking
Example usage:
|
|
The connectivity_resource_groups
variable is used to specify the name and location of the resource groups used for connectivity.
This variable is a map(object)
and has two properties:
name
: The resource group namelocation
: The resource group location
Example usage:
|
|
The hub_and_spoke_vnet_settings
variable is used to set the non-regional settings for the hub and spoke Virtual Network connectivity option. It is only used to set the DDOS Protection Plan at this time.
This variable is of type any
as it will be used for other purposes moving forward.
Example usage:
|
|
The hub_and_spoke_vnet_virtual_networks
variable is used to set the regional settings for the hub and spoke Virtual Network connectivity options. This includes Hub Networks, Peering, Routing, Subnets, Firewalls, Virtual Network Gateways, Bastion Hosts, Private DNS Zones, and Private DNS Resolver
This variable is of type map(object)
. Some of the object properties map directly to the Azure Verified Module variables. To determine what can be supplied to these variable you can refer to the documentation for this module directly.
The map(object)
definition can be found here.
The supported object properties are:
hub_virtual_network
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-hubnetworkingbastion
: This anobject
to specify the Bastion Host settings (omit this object if you don’t want to deploy a Bastion Host)subnet_address_prefix
: The Bastion Host subnet address spacebastion_host
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-res-network-bastionhostbastion_public_ip
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-res-network-publicipaddress
virtual_network_gateways
: This anobject
to specify the Virtual Network Gateways settings (omit this object if you don’t want to deploy any Virtual Network Gateways)subnet_address_prefix
: The Virtual Network Gateway subnet address spaceexpress_route
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-vnetgatewayvpn
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-vnetgateway
private_dns_zones
: This anobject
to specify the Private DNS Zone settings (omit this object if you don’t want to deploy any Private DNS Zones)subnet_address_prefix
: The Private DNS Resolver subnet address spaceresource_group_name
: The name of the resource group to deploy the Private DNS Zones intois_primary
: Whether this is the primary region. Any non-regional Private Link Private DNS Zones will be deployed into this region. Although the Private DNS Zones are a global resource, their meta-data needs to reside in a specific region.private_link_private_dns_zones
: This is amap(object)
used to override the Private Link Private DNS Zones that are deployed, leave this empty to deploy the default set of zones specified by ALZzone_name
: The name of the Private DNS Zone to deploy
auto_registration_zone_enabled
: Whether to deploy the Virtual Machine auto-registration Private DNS Zoneauto_registration_zone_name
: The name of the Virtual Machine auto-registration Private DNS Zoneprivate_dns_resolver
: This is anobject
to specify the Private DNS Resolvername
: The name of the Private DNS Resolverresource_group_name
: The name of the resource group to deploy the Private DNS Resolver intoip_address
: The static IP Address of the Private DNS Resolver. This will be auto calculated if not supplied
Example usage:
|
|
The virtual_wan_settings
variable is used to set the non-regional settings for the Virtual WAN connectivity option. It is used to set the Virtual WAN non-regional properites and the DDOS Protection Plan.
This variable is of type any
as it maps directly to the Azure Verified Module variables. To determine what can be supplied to this variable you can refer to the documentation for this module directly:
Documentation link: registry.terraform.io/modules/Azure/avm-ptn-virtualwan
Example usage:
|
|
The hub_and_spoke_vnet_virtual_networks
variable is used to set the regional settings for the Virtual WAN connectivity options. This includes Virtual WAN Hubs, Firewalls, Virtual Network Gateways, Bastion Hosts, Private DNS Zones, and Private DNS Resolver
This variable is of type map(object)
. Some of the object properties map directly to the Azure Verified Module variables. To determine what can be supplied to these variable you can refer to the documentation for this module directly.
The map(object)
definition can be found here.
The supported object properties are:
hub
: Thisobject
maps directly to thevirtual_hubs
variable of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-virtualwanfirewall
: Thisobject
maps directly to thefirewalls
variable of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-virtualwanfirewall_policy
: Thisobject
maps directly to the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-res-network-firewallpolicybastion
: This anobject
to specify the Bastion Host settings (omit this object if you don’t want to deploy a Bastion Host)subnet_address_prefix
: The Bastion Host subnet address spacebastion_host
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-res-network-bastionhostbastion_public_ip
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-res-network-publicipaddress
virtual_network_gateways
: This anobject
to specify the Virtual Network Gateways settings (omit this object if you don’t want to deploy any Virtual Network Gateways)express_route
: Thisobject
maps directly to theexpressroute_gateways
variable of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-virtualwanvpn
: Thisobject
maps directly to thevpn_gateways
variable of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-ptn-virtualwan
private_dns_zones
: This anobject
to specify the Private DNS Zone settings (omit this object if you don’t want to deploy any Private DNS Zones)subnet_address_prefix
: The Private DNS Resolver subnet address spaceresource_group_name
: The name of the resource group to deploy the Private DNS Zones intois_primary
: Whether this is the primary region. Any non-regional Private Link Private DNS Zones will be deployed into this region. Although the Private DNS Zones are a global resource, their meta-data needs to reside in a specific region.private_link_private_dns_zones
: This is amap(object)
used to override the Private Link Private DNS Zones that are deployed, leave this empty to deploy the default set of zones specified by ALZzone_name
: The name of the Private DNS Zone to deploy
auto_registration_zone_enabled
: Whether to deploy the Virtual Machine auto-registration Private DNS Zoneauto_registration_zone_name
: The name of the Virtual Machine auto-registration Private DNS Zoneprivate_dns_resolver
: This is anobject
to specify the Private DNS Resolvername
: The name of the Private DNS Resolverresource_group_name
: The name of the resource group to deploy the Private DNS Resolver intoip_address
: The static IP Address of the Private DNS Resolver. This will be auto calculated if not supplied
side_car_virtual_network
: Thisobject
maps directly to the variables of the Azure Verified Module, which can be found here: registry.terraform.io/modules/Azure/avm-res-network-virtualnetwork
Example usage:
|
|
For reference, the following is a list of the Azure Verified Modules used by this starter module
Applies To | Module Type | Module Name | Description | Link |
---|---|---|---|---|
All | Pattern | Management Groups and Policy | Used to create the management group structure, deploy policy definitions, assign policies, and create role assignments | https://github.com/Azure/terraform-azurerm-avm-ptn-alz |
All | Pattern | Management Resources | Used to deploy the management resource, including log analytics workspace and automation account | https://github.com/Azure/terraform-azurerm-avm-ptn-alz-management |
All | Utility | Regions | Used to lookup the availability zones in the regions selected, so they can be used in the replacements | https://github.com/Azure/terraform-azurerm-avm-utl-regions |
Both Connectivity | Resource | Resource Group | Used to create the Resource Groups if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-res-resources-resourcegroup |
Both Connectivity | Resource | Private DNS Resolver | Used to deploy the Private DNS Resolver if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-res-network-dnsresolver |
Both Connectivity | Pattern | Private Link Private DNS Zones | Used to deploy the Private Link Private DNS Zones if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-ptn-network-private-link-private-dns-zones |
Both Connectivity | Resource | Private DNS Zone | Used to deploy the Virtual Machine auto-registration DNS Zone if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-res-network-privatednszone |
Both Connectivity | Resource | DDOS Protection Plan | Used to deploy the DDOS Protection Plan if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-res-network-ddosprotectionplan |
Both Connectivity | Resource | Public IP Address | Used to deploy the Public IP Address for the Bastion Host if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-res-network-publicipaddress |
Both Connectivity | Resource | Bastion Host | Used to deploy the Bastion Host if connectivity is enabled | https://github.com/Azure/terraform-azurerm-avm-res-network-bastionhost |
Hub and Spoke VNET | Pattern | Hub Networking | Used to deploy and configure the Hub and Spoke Virtual Network if that option is selected | https://github.com/Azure/terraform-azurerm-avm-ptn-hubnetworking |
Hub and Spoke VNET | Pattern | Virtual Network Gateways | Used to deploy the virtual network gateways for the Hub and Spoke Virtual Network options | https://github.com/Azure/terraform-azurerm-avm-ptn-vnetgateway |
Virtual WAN | Pattern | Virtual WAN | Used to deploy and configure the Virtual WAN if that option is selected | https://github.com/Azure/terraform-azurerm-avm-ptn-virtualwan |
Virtual WAN | Resource | Firewall Policy | Used to deploy the Firewall Policy if the Virtual WAN option is selected | https://github.com/Azure/terraform-azurerm-avm-res-network-firewallpolicy |
Virtual WAN | Resource | Virtual Network | Used to deploy the Sidecar Virtual Network and Subnets if the Virtual WAN option is selected | https://github.com/Azure/terraform-azurerm-avm-res-network-virtualnetwork |