File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
infrastructure/modules/application-insights-availability-test Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,21 @@ resource "azurerm_application_insights_standard_web_test" "this" {
1414
1515 geo_locations = var. geo_locations
1616}
17+
18+ resource "azurerm_monitor_metric_alert" "this" {
19+ name = " ${ var . name } -availability-alert"
20+ resource_group_name = var. resource_group_name
21+ scopes = [azurerm_application_insights_standard_web_test . this . id , var . application_insights_id ]
22+ description = " availability test alert"
23+ severity = 0
24+
25+ application_insights_web_test_location_availability_criteria {
26+ web_test_id = azurerm_application_insights_standard_web_test. this . id
27+ component_id = var. application_insights_id
28+ failed_location_count = 2
29+ }
30+
31+ action {
32+ action_group_id = var. action_group_id
33+ }
34+ }
Original file line number Diff line number Diff line change 44
55The following input variables are required:
66
7+ ### <a name =" input_action_group_id " ></a > [ action\_ group\_ id] ( #input\_ action\_ group\_ id )
8+
9+ Description: ID of the action group to notify.
10+
11+ Type: ` string `
12+
713### <a name =" input_application_insights_id " ></a > [ application\_ insights\_ id] ( #input\_ application\_ insights\_ id )
814
915Description: The Application Insights resource id to associate the availability test with
@@ -78,3 +84,4 @@ Default: `30`
7884The following resources are used by this module:
7985
8086- [ azurerm_application_insights_standard_web_test.this] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/application_insights_standard_web_test ) (resource)
87+ - [ azurerm_monitor_metric_alert.this] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert ) (resource)
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ variable "application_insights_id" {
2323 description = " The Application Insights resource id to associate the availability test with"
2424}
2525
26+ variable "action_group_id" {
27+ type = string
28+ description = " ID of the action group to notify."
29+ }
30+
2631variable "frequency" {
2732 type = number
2833 default = 300
You can’t perform that action at this time.
0 commit comments