Skip to content

Commit

Permalink
azurerm_monitor_alert_processing_rule_action_group, `azurerm_monito…
Browse files Browse the repository at this point in the history
…r_alert_processing_rule_suppression` - add `monitor_condition` in AtLeastOneOf #19338
  • Loading branch information
teowa authored Nov 17, 2022
1 parent 6084027 commit d4e6718
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
55 changes: 33 additions & 22 deletions internal/services/monitor/alert_processing_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,30 @@ func schemaAlertProcessingRule() map[string]*pluginsdk.Schema {
"alert_context": schemaAlertProcessingRuleCondition(
alertprocessingrules.PossibleValuesForOperator(), nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"alert_rule_id": schemaAlertProcessingRuleCondition(
alertprocessingrules.PossibleValuesForOperator(), nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"alert_rule_name": schemaAlertProcessingRuleCondition(
alertprocessingrules.PossibleValuesForOperator(), nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"description": schemaAlertProcessingRuleCondition(
alertprocessingrules.PossibleValuesForOperator(), nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"monitor_condition": schemaAlertProcessingRuleCondition(
[]string{
Expand All @@ -134,8 +138,9 @@ func schemaAlertProcessingRule() map[string]*pluginsdk.Schema {
"Resolved",
},
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"monitor_service": schemaAlertProcessingRuleCondition(
[]string{
Expand Down Expand Up @@ -167,8 +172,9 @@ func schemaAlertProcessingRule() map[string]*pluginsdk.Schema {
"VM Insights - Health",
},
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"severity": schemaAlertProcessingRuleCondition(
[]string{
Expand All @@ -183,8 +189,9 @@ func schemaAlertProcessingRule() map[string]*pluginsdk.Schema {
"Sev4",
},
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"signal_type": schemaAlertProcessingRuleCondition(
[]string{
Expand All @@ -198,20 +205,23 @@ func schemaAlertProcessingRule() map[string]*pluginsdk.Schema {
"Health",
},
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"target_resource": schemaAlertProcessingRuleCondition(
alertprocessingrules.PossibleValuesForOperator(), nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"target_resource_group": schemaAlertProcessingRuleCondition(
alertprocessingrules.PossibleValuesForOperator(), nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
"target_resource_type": schemaAlertProcessingRuleCondition(
[]string{
Expand All @@ -220,8 +230,9 @@ func schemaAlertProcessingRule() map[string]*pluginsdk.Schema {
},
nil,
[]string{"condition.0.alert_context", "condition.0.alert_rule_id", "condition.0.alert_rule_name",
"condition.0.description", "condition.0.monitor_service", "condition.0.severity", "condition.0.signal_type",
"condition.0.target_resource", "condition.0.target_resource_group", "condition.0.target_resource_type"},
"condition.0.description", "condition.0.monitor_condition", "condition.0.monitor_service",
"condition.0.severity", "condition.0.signal_type", "condition.0.target_resource",
"condition.0.target_resource_group", "condition.0.target_resource_type"},
),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ A `condition` block supports the following:

* `target_resource_type` - (Optional) A `target_resource_type` block as defined below.

-> **Note:** At least one of the `alert_context`, `alert_rule_id`, `alert_rule_name`, `description`, `monitor_condition`, `monitor_service`, `severity`, `signal_type`, `target_resource`, `target_resource_group`, `target_resource_type` must be specified.

---

A `daily` block supports the following:
Expand Down

0 comments on commit d4e6718

Please sign in to comment.