Foundation units¶
live/_foundation/ holds the three units that build the platform: the management
resources, the management group hierarchy with its policy, and Azure Monitor
Baseline Alerts. This page covers what each one deploys, the module it uses,
and the values you must edit before the first apply.
The shape of a unit¶
Every foundation unit is a pair of files.
| File | Owns |
|---|---|
terragrunt.hcl |
How the unit wires into the tree: the root include, the backend, the providers, the ordering. |
main.tf |
Plain Terraform. A module block sourcing an Azure Verified Module, with the inputs inline. |
The AVM module owns the schema, so main.tf is ordinary Terraform you can read
without knowing Terragrunt. Terragrunt generates the backend, the providers, and
the context, from the root contract.
Each unit has its own state, keyed by its path under the live tree. A change to the AMBA unit does not re-plan the policy unit. They apply in one order:
management-resources # no dependencies
-> landing-zones # dependencies { paths = ["../management-resources"] }
-> amba # dependencies { paths = ["../landing-zones"] }
The dependencies blocks are ordering only. They declare no outputs and read no
values from each other. Where one unit needs a value from another, the value is
rebuilt from a naming convention instead. That constraint is explained under
landing-zones below.
Where location comes from¶
The units take no Terragrunt inputs. They read the region from the generated
context.tf instead, which live/root.hcl writes into every unit at run time
from the nearest region.hcl and env.hcl. All three main.tf files use
local.context.location and local.context.location_short, and
management-resources/main.tf also tags with local.context.environment, which
comes from live/_foundation/env.hcl.
So live/_foundation/region.hcl is the single source of truth for the
foundation's region. Changing it is a one file edit, and the three units follow on
the next run. There is nothing to keep in sync by hand. See
Root contract.
Values that are not inherited stay literal. landing-zones/main.tf keeps
connectivity_subscription_id as a literal because the connectivity subscription
is not an ancestor of the foundation folder, so no subscription.hcl above it
carries that value.
Global versus regional, and what location means¶
Every foundation module requires a location, but it means two different
things, and that is the whole reason the foundation stays single:
| Unit | Module | location is |
Per region? |
|---|---|---|---|
landing-zones |
avm-ptn-alz (nrit) |
only the region for the policy managed identities; the MGs are global | no |
amba (policy half) |
avm-ptn-alz (amba) |
only the region for the AMBA policy identities | no |
management-resources |
avm-ptn-alz-management |
the real home of the Log Analytics workspace and DCRs | choice |
amba (resources half) |
avm-ptn-monitoring-amba-alz |
the real home of the AMBA resource group and identity | no, singleton |
Where location is nominal (the two policy modules), the region is just a
primary you pin once. Where it is real (the workspace), region is a genuine
choice that only matters for multi-region.
A foundation does not multiply per region. What multiplies is connectivity (a
hub per region) and the landing-zone workloads (spokes per region). With a
single central management workspace, the ALZ single-pane default, the entire
foundation stays one deployment, and adding a region does not touch
_foundation/ at all. Only data residency changes this: if EU and US logs
cannot co-mingle, governance stays global in _foundation/ but the workspace
moves down to a per-region folder under
platform/management/<region>/management-resources/, with the AMA policy
pointing at the primary region's workspace. That is a heavier shape with
cross-tree references, so only adopt it when residency requires it. See
Add a region for the
day-2 side of this.
Deploy order¶
_foundation/ first (the management groups must exist before anything is
placed into them), then platform/ (connectivity hubs), then landingzones/.
Within _foundation/, the unit order is management-resources, then
landing-zones (its policy references the workspace), then amba.
Terragrunt enforces order only where a unit declares it. A dependencies block
in landing-zones/terragrunt.hcl puts management-resources first, one in
amba/terragrunt.hcl puts landing-zones first, and one in a workload spoke's
network unit puts the connectivity hub and the subscription placement first.
The wider layer order above is operational: nothing declares that all of
_foundation/ precedes all of platform/. Add a dependencies block whenever
a new unit needs a guaranteed predecessor; when a unit needs a value from
another unit rather than just ordering, see
Sharing data between units.
management-resources¶
The central monitoring resources every other unit points at.
| Item | Value |
|---|---|
| Module | Azure/avm-ptn-alz-management/azurerm |
| State | its own |
It deploys a resource group, a Log Analytics workspace with 30 day retention,
three data collection rules (change tracking, VM insights, Defender for SQL), and
one user-assigned managed identity for the Azure Monitoring Agent. The automation
account is switched off with automation_account_name = null.
Its terragrunt.hcl is the minimal case: a root include with expose = true, and
nothing else. No generate "provider" block, because the root default of
azurerm, azapi, and azuread covers what the module needs. No dependencies,
because it is first.
The six resource names it creates are a contract:
rg-management-weu
log-management-weu
dcr-change-tracking-weu
dcr-vm-insights-weu
dcr-defender-sql-weu
id-management-ama-weu
The landing-zones unit rebuilds every one of those names by string, to point
policy at them. They must not drift. If you rename one here, rename it there in
the same commit.
You edit: nothing here. The businessunit tag comes from business_unit in
live/customer.hcl, through local.context.business_unit.
landing-zones¶
The management group hierarchy, the base policy set, subscription placement, and the resource providers AMBA needs on each placed subscription.
| Item | Value |
|---|---|
| Module | Azure/avm-ptn-alz/azurerm |
| State | its own |
What the terragrunt.hcl does differently¶
It sets merge_strategy = "deep" on the root include and declares its own
generate "provider" block. Two generate blocks with the same name are a hard
error under the default merge, so the deep merge is what lets the child block
override the root's instead of colliding with it.
The block it generates requires alz (~> 0.22) and azapi (~> 2.12). There is
no azurerm provider in this unit at all: the module talks to Azure through
azapi and reads its policy assets through alz.
The alz provider is configured with an ordered list:
provider "alz" {
library_overwrite_enabled = true
library_references = [
{ path = "platform/alz", ref = "2026.10.0" },
{ custom_url = "${get_terragrunt_dir()}/lib" },
]
}
Order is the whole point. The stock ALZ library is read first, then the vendored
local library layers on top, and library_overwrite_enabled = true lets a local
asset replace a stock asset of the same name. Reverse the two and the stock
library wins. See Vendored policy library.
Policy default values, computed from names¶
policy_default_values feeds the shared monitoring ids to every assignment
parameter in the library that declares them. The unit builds each id as a string,
concatenating the subscription id, the management resource group name, the
provider namespace, and the resource name.
It does not read them from the management-resources state. It cannot. The alz
provider reads a data source at plan time and a data source cannot take a value
that is unknown until apply. So the ids are computed from the naming convention,
which is why those six names are a contract rather than a detail.
The active policy_assignments_to_modify¶
Four entries ship active:
| Management group | Assignment | Change |
|---|---|---|
alz |
Enforce-Tag-Gov |
All four effect parameters pinned to Audit. |
alz |
Deploy-MDFC-Config-H224 |
enableAscForAI = Disabled. |
connectivity |
Enable-DDoS-VNET |
creation_enabled = false. |
landingzones |
Enable-DDoS-VNET |
creation_enabled = false. |
Tag governance stays advisory while resource groups are reconciled. The DDoS
assignment is opted out so VNet creates work without a DDoS plan, which carries a
monthly cost. The stock Defender for Cloud assignment sets every plan to
Disabled except Defender for AI Services. That parameter falls back to the set
default, DeployIfNotExists, which would turn the plan on (Standard, with prompt
evidence capture) in every subscription that joins the hierarchy. The platform
sets it to Disabled explicitly. The reasoning behind all three, and the order to
harden them in, is
Enforcement strategy.
Resource providers for AMBA¶
AMBA needs Microsoft.AlertsManagement and microsoft.insights registered on
every subscription it covers. Without Microsoft.AlertsManagement the
Deploy-AMBA-Notification policy cannot create its alert processing rules
(MissingSubscriptionRegistration), and the AMBA alerts, which carry no action
group of their own, reach no one.
The root provider block registers nothing, so the unit that places a
subscription registers its providers. landing-zones does it for the platform
subscriptions in subscription_placement, with one azapi_resource_action per
subscription and provider: a POST to
/subscriptions/<id>/providers/<namespace>/register, the same call the
sub-vending module makes. It is idempotent, so a provider that is already
registered is a no-op. A landing zone subscription registers the two through its
lz-vending unit's resource_providers list instead.
The two commented blocks¶
main.tf carries two large commented locals, both inert. They ship commented on
purpose: they are reference material to lift from, not configuration.
common_customizations: the stock ALZ settings customers change on day one, led by the Microsoft Defender for Cloud config assignment. It also documents each modify capability as a worked snippet:enforcement_mode,creation_enabled,parameters, phasedresource_selectors,not_scopes,overrides, andnon_compliance_messages.prod_hardening: the recommended move from the soft AVM default posture to enforced. Tag governance toDeny, then a Wave 1 of data service guardrails, then a Wave 2 of compute, container, network, and app guardrails, then private subnets. Customer-managed keys are left commented out even inside the block.
To use either, copy the entries you want into policy_assignments_to_modify,
merging by management group key. Do not enable a whole block at once. Read
Enforcement strategy first.
You edit: nothing, in most repositories. architecture_name already ships as
"baseline", matching the single architecture the vendored lib/ defines, and
connectivity_subscription_id ships as an empty string, which is valid: the unit
drops the connectivity entry from subscription_placement when it is empty. Set
connectivity_subscription_id in landing-zones/main.tf when you onboard a
connectivity hub, and change architecture_name only if you add a second
architecture to lib/.
amba¶
Azure Monitor Baseline Alerts. Two modules in one state.
| Item | Value |
|---|---|
| Modules | Azure/avm-ptn-monitoring-amba-alz/azurerm and Azure/avm-ptn-alz/azurerm |
| State | its own, shared by both modules |
amba_resources creates the AMBA resource group and the user-assigned identity
that remediation runs as. amba_policy is the same ALZ pattern module as the
landing-zones unit, but with architecture_name = "amba", overlaying the AMBA
policy set on the hierarchy that already exists.
They share one state because the policy needs the identity the resources create.
This is a genuinely computed cross-reference, not a name that can be rebuilt: the
module takes policy_assignments_dependencies and
policy_role_assignments_dependencies, both set to [module.amba_resources]. A
module reference like that only works inside one configuration, so the two live
together.
Its terragrunt.hcl also deep-merges the root include and generates its own
providers, but the set is alz, azapi, and azurerm, since the AMBA resources
module needs azurerm. Its alz provider takes the AMBA library only:
The unit does not load platform/alz. The amba architecture uses only the
amba_* archetypes, every policy asset they reference ships in
platform/amba, and the library declares no dependencies. So the
platform/alz ref is set in landing-zones alone.
Use platform/amba 2026.10.0 or later. Azure rejects four policy sets in
2026.06.2 with PolicySetParameterAllowedValuesMismatch
(Azure/azure-monitor-baseline-alerts#936),
so a fresh deploy on that release fails at this unit.
You edit: nothing here. The action group inbox and the businessunit tag
come from amba_action_group_email and business_unit in live/customer.hcl,
through local.context. The same inbox feeds two action groups: the AMBA
notification group (amba_alz_action_group_email) and the Service Health group
ag-ServiceHealthAlertActionGroup (amba_alz_sha_action_group_resources).
Without the second default the Service Health group deploys with no receivers.
Two things that will bite you in the AMBA unit
The action group email is wrapped in a list: [local.amba_action_group_email].
The policy parameter behind it is of type Array. A bare string passes plan
and fails at apply with InvalidPolicyParameterType.
The AMBA resource group has two writers. AMBA's remediation re-creates it
from its own template with the tags in the ALZMonitorResourceGroupTags
policy parameter, replacing the whole tag set, and Terraform sets its tags
through the amba_resources module. The unit gives both the same map,
amba_resource_group_tags (the governance tags plus _deployed_by_amba):
as the module's tags and as the policy default
amba_alz_resource_group_tags. Change a tag in that one map and both
sides follow. Set tags in only one place and the unit drifts on every
remediation cycle.
Everything pinned in the foundation¶
The module versions, the library refs, the provider constraints, and how to move each one are on Versions and upgrades.