torumakabe / az-ama-tf-sample

Sample Terraform HCL codes for Azure Monitor Agent (AMA)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample Terraform HCL codes for Azure Monitor Agent (AMA)

Table of Contents

About

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)

Note

The sample codes have some workarouds such as managing Data Collection Rules with templates & Azure CLI.

Support for Azure Monitor Data Collection Rules

These restrictions & lacks of Terraform resource may be improved in the future, so please check the latest information on AMA and Terraform before using.

Getting Started

  1. Deploy shared monitoring service resources
  2. Deploy monitoring target resources

Prerequisites & Tested

  • 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

About

Sample Terraform HCL codes for Azure Monitor Agent (AMA)

License:MIT License


Languages

Language:HCL 71.5%Language:Smarty 26.9%Language:Shell 1.6%