Deploy with Terraform
Example of deploying AMBA-ALZExample of deploying a Custom ArchitectureExample of deploying with Custom Policy AssignmentsData CollectionNext Steps
- Example of deploying AMBA-ALZ: This example demonstrates how to deploy the AMBA-ALZ pattern using an existing management group hierarchy with default naming as used in the ALZ Architecture Definition.
- Example of deploying a Custom Architecture: This example demonstrates how to deploy the AMBA-ALZ pattern using an existing custom management group hierarchy.
- Example of deploying with Custom Policy Assignments: It is possible to tailor the Policy Definitions that are deployed and assigned by developing custom archetypes. This example demonstrates a situation where only Service Health is deployed, but can be applied to other policy assignments as well.
This example demonstrates how to deploy the AMBA-ALZ pattern using an existing management group hierarchy with default naming as used in the ALZ Architecture Definition.
Create a new directory, for example
tf-amba-alz
.Open Visual Studio Code or another preferred tool.
Select
Open Folder...
from the File menu (or Ctrl+K Ctrl+O) and opentf-amba-alz
Open a Terminal (PowerShell).
Depending on the tool being used, it may be necessary to change the terminal to the `tf-amba-alz` directory.
Download
terraform.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/complete/terraform.tf -OutFile terraform.tf
Download
main.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/complete/main.tf -OutFile main.tf
Download
variables.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/complete/variables.tf -OutFile variables.tf
The source and version of the module need to be updated in
main.tf
. Findmodule "amba_alz"
and replacesource = "../../"
With:
source = "Azure/avm-ptn-monitoring-amba-alz/azurerm" version = "0.1.1"
Review the variables in
variables.tf
and update default values as needed.Log in to Azure:
az login
Run:
terraform init
Run:
terraform apply
This example demonstrates how to deploy the AMBA-ALZ pattern using an existing custom management group hierarchy.
Create a new directory, for example
tf-amba-alz
.Open Visual Studio Code or another preferred tool.
Select
Open Folder...
from the File menu (or Ctrl+K Ctrl+O) and opentf-amba-alz
Open a Terminal (PowerShell).
Depending on the tool being used, it may be necessary to change the terminal to the `tf-amba-alz` directory.
Download
terraform.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-architecture-definition/terraform.tf -OutFile terraform.tf
Download
main.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-architecture-definition/main.tf -OutFile main.tf
Download
variables.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-architecture-definition/variables.tf -OutFile variables.tf
The source and version of the module need to be updated in
main.tf
. Findmodule "amba_alz"
and replacesource = "../../"
With:
source = "Azure/avm-ptn-monitoring-amba-alz/azurerm" version = "0.1.1"
Review the variables in
variables.tf
and update default values as needed.Set up a directory to store the custom library assets:
New-Item -name lib -ItemType directory
Download the
custom.alz_architecture_definition.json
file to thelib
directory.cd .\lib\
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-architecture-definition/lib/custom.alz_architecture_definition.json -OutFile custom.alz_architecture_definition.json
Adjust the management group
display name
,id
andparent id
in custom.alz_architecture_definition.json.Return to the
tf-amba-alz
directory in the terminal.cd..
Log in to Azure:
az login
Run:
terraform init
Run:
terraform apply
It is possible to tailor the Policy Definitions that are deployed and assigned by developing custom archetypes. This example demonstrates a situation where only Service Health is deployed, but can be applied to other policy assignments as well:
- Deploy using a custom management group hierarchy defined by architecture definition file in the local library.
- Use a custom root archetype to ensure that the Service Health policy definitions and assignments are deployed.
Deployment:
Create a new directory, for example
tf-amba-alz
.Open Visual Studio Code or another preferred tool.
Select
Open Folder...
from the File menu (or Ctrl+K Ctrl+O) and opentf-amba-alz
Open a Terminal (PowerShell).
Depending on the tool being used, it may be necessary to change the terminal to the `tf-amba-alz` directory.
Download
terraform.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-policy-assignment/terraform.tf -OutFile terraform.tf
Download
main.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-policy-assignment/main.tf -OutFile main.tf
Download
variables.tf
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-policy-assignment/variables.tf -OutFile variables.tf
The source and version of the module need to be updated in
main.tf
. Findmodule "amba_alz"
and replacesource = "../../"
With:
source = "Azure/avm-ptn-monitoring-amba-alz/azurerm" version = "0.1.1"
Review the variables in
variables.tf
and update default values as needed.Set up a directory to store the custom library assets:
New-Item -name lib -ItemType directory
Download the
custom.alz_architecture_definition.json
file to thelib
directory.cd .\lib\
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-policy-assignment/lib/custom.alz_architecture_definition.json -OutFile custom.alz_architecture_definition.json
Adjust the management group
display name
,id
andparent id
in custom.alz_architecture_definition.json.Download the
root.alz_archetype_definition.json
file to thelib
directory.Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-ptn-monitoring-amba-alz/refs/heads/main/examples/custom-policy-assignment/lib/root.alz_archetype_definition.json -OutFile root.alz_archetype_definition.json
Return to the
tf-amba-alz
directory in the terminal.cd..
Log in to Azure:
az login
Run:
terraform init
Run:
terraform apply
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
To remediate non-compliant policies, continue with Policy Remediation.