Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_monitor_activity_log_alert: support properties.recommendationType #7458

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -123,6 +123,10 @@ func resourceArmMonitorActivityLogAlert() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"recommendation_type": {
Type: schema.TypeString,
Optional: true,
},
},
},
},
Expand Down Expand Up @@ -348,6 +352,12 @@ func expandMonitorActivityLogAlertCriteria(input []interface{}) *insights.Activi
Equals: utils.String(subStatus),
})
}
if recommendationType := v["recommendation_type"].(string); recommendationType != "" {
conditions = append(conditions, insights.ActivityLogAlertLeafCondition{
Field: utils.String("properties.recommendationType"),
Equals: utils.String(recommendationType),
})
}

return &insights.ActivityLogAlertAllOfCondition{
AllOf: &conditions,
Expand Down Expand Up @@ -397,6 +407,8 @@ func flattenMonitorActivityLogAlertCriteria(input *insights.ActivityLogAlertAllO
result["resource_id"] = *condition.Equals
case "substatus":
result["sub_status"] = *condition.Equals
case "recommendationType":
result["recommendation_type"] = *condition.Equals
case "caller", "category", "level", "status":
result[*condition.Field] = *condition.Equals
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/monitor_activity_log_alert.html.markdown
Expand Up @@ -93,6 +93,7 @@ A `criteria` block supports the following:
* `level` - (Optional) The severity level of the event. Possible values are `Verbose`, `Informational`, `Warning`, `Error`, and `Critical`.
* `status` - (Optional) The status of the event. For example, `Started`, `Failed`, or `Succeeded`.
* `sub_status` - (Optional) The sub status of the event.
* `recommendation_type` - (Optional) The recommendation type of the event. It is only allowed when `category` is `Recommendation`.

## Attributes Reference

Expand Down