Skip to content

Instantly share code, notes, and snippets.

@appcoreopc
Created August 23, 2019 03:38
Show Gist options
  • Save appcoreopc/024226ac3945a04cfce5d609c1ab9683 to your computer and use it in GitHub Desktop.
Save appcoreopc/024226ac3945a04cfce5d609c1ab9683 to your computer and use it in GitHub Desktop.
data "azurerm_app_service_plan" "test" {
name = "devspapptest"
resource_group_name = "devrgapptest"
}
resource "azurerm_monitor_autoscale_setting" "test" {
name = "devspapptest-Autoscale-9680"
resource_group_name = "devrgapptest"
location = "AustraliaEast"
target_resource_id = "${data.azurerm_app_service_plan.test.id}"
profile {
name = "defaultProfile2"
capacity {
default = 1
minimum = 1
maximum = 3
}
rule {
metric_trigger {
metric_name = "CpuPercentage"
metric_resource_id = "${data.azurerm_app_service_plan.test.id}"
statistic = "Average"
time_window = "PT5M"
time_grain = "PT5M"
time_aggregation = "Average"
operator = "GreaterThan"
threshold = 60
}
scale_action {
direction = "Increase"
type = "ChangeCount"
value = "1"
cooldown = "PT10M"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment