Skip to content

Commit

Permalink
Only store service.AlertGroupingParameters in alert_grouping_paramete…
Browse files Browse the repository at this point in the history
…rs if it is defined in configuration
  • Loading branch information
pdecat committed Aug 20, 2021
1 parent 150448d commit 16b75f5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pagerduty/resource_pagerduty_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func resourcePagerDutyService() *schema.Resource {
},
"alert_grouping_parameters": {
Type: schema.TypeList,
Computed: true,
Optional: true,
MaxItems: 1,
ConflictsWith: []string{"alert_grouping", "alert_grouping_timeout"},
Expand Down Expand Up @@ -445,7 +444,7 @@ func flattenService(d *schema.ResourceData, service *pagerduty.Service) error {
} else {
d.Set("alert_grouping_timeout", strconv.Itoa(*service.AlertGroupingTimeout))
}
if service.AlertGroupingParameters != nil {
if _, ok := d.GetOk("alert_grouping_parameters"); ok && service.AlertGroupingParameters != nil {
if err := d.Set("alert_grouping_parameters", flattenAlertGroupingParameters(service.AlertGroupingParameters)); err != nil {
return err
}
Expand Down

0 comments on commit 16b75f5

Please sign in to comment.