Based on the autoscale rule criteria I am trying to create a terraform azurerm_monitor_autoscale_setting
rule which increase/decreases VM nodes based on Disk Write Operations/Sec or Disk Write Bytes. The metric trigger looks like the following:
rule {
metric_trigger {
operator = "GreaterThan"
threshold = 50
time_grain = "PT1M"
statistic = "Average"
time_window = "PT5M"
metric_name = "Disk Write Operations/Sec"
time_aggregation = "Average"
}
}
However, I believe this is not the right syntax since once applying the terraform script it never creates this rule. On the other hand replacing the rule with "Percentage CPU" works fine. Have anyone created any metrics other than "Percentage CPU"? Can you help figuring out what is the right way to do it in terraform
?