Azure Monitor Agent(AMA) is now generally available, but there isn't much information to use at this time. This repository contains Terraform HCL sample codes for AMA. Please use it as a sample in the transition period.
With this sample, you can mainly experience the following:
- Deploy monitoring services (Azure Monitor Log Analytics workspace, Action Group)
- Deploy sample monitoring target (VM)
- Install AMA extention to VM
- Generate & deploy Data Colletion Rules (VM guest OS performance counters and Syslog)
- Associate Data Collection Rules to VM
- Setup Alert Rules
- VM host metric (CPU usage)
- VM guest metric (Disk free space)
- Syslog query (detection specified strings)
The sample codes have some workarouds such as managing Data Collection Rules with templates & Azure CLI.
These restrictions & lacks of Terraform resource may be improved in the future, so please check the latest information on AMA and Terraform before using.
- Terraform: 1.0.4
- hashicorp/azurerm: 2.71
- on Linux (need local-exec shell provisioner)
- Azure CLI: 2.27.1
- monitor-control-service extension: 0.2.0