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

New Resource: azurerm_monitor_activitylog_alert #1989

Merged
merged 11 commits into from
Oct 15, 2018
Prev Previous commit
Next Next commit
ignore the empty element in action set
  • Loading branch information
Junyi Yi committed Oct 12, 2018
commit 3b8784182957f27d60799c4ba439af86cb4ecb35
21 changes: 11 additions & 10 deletions azurerm/resource_arm_monitor_activity_log_alert.go
Original file line number Diff line number Diff line change
@@ -301,18 +301,19 @@ func expandMonitorActivityLogAlertAction(input []interface{}) *insights.Activity
actions := make([]insights.ActivityLogAlertActionGroup, 0)
for _, item := range input {
v := item.(map[string]interface{})

props := make(map[string]*string)
if pVal, ok := v["webhook_properties"]; ok {
for pk, pv := range pVal.(map[string]interface{}) {
props[pk] = utils.String(pv.(string))
if agID := v["action_group_id"].(string); agID != "" {
props := make(map[string]*string)
if pVal, ok := v["webhook_properties"]; ok {
for pk, pv := range pVal.(map[string]interface{}) {
props[pk] = utils.String(pv.(string))
}
}
}

actions = append(actions, insights.ActivityLogAlertActionGroup{
ActionGroupID: utils.String(v["action_group_id"].(string)),
WebhookProperties: props,
})
actions = append(actions, insights.ActivityLogAlertActionGroup{
ActionGroupID: utils.String(agID),
WebhookProperties: props,
})
}
}
return &insights.ActivityLogAlertActionList{
ActionGroups: &actions,