Skip to content

Commit

Permalink
[ING-1822] Mark alert_creation as deprecated and hide diffs that will…
Browse files Browse the repository at this point in the history
… be due to the sunsetting of incidents only
  • Loading branch information
syogeswaran committed Mar 13, 2024
1 parent 690ce6e commit 57d5994
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions pagerduty/resource_pagerduty_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ func resourcePagerDutyService() *schema.Resource {
Default: "Managed by Terraform",
},
"alert_creation": {
Type: schema.TypeString,
Optional: true,
Default: "create_incidents",
Type: schema.TypeString,
Optional: true,
Deprecated: "Remove use of this attribute as all services are being migrated to use alerts and incidents and this property will no longer be configurable. This will be removed in an upcoming major version. See knowledge base for details https://support.pagerduty.com/docs/alerts#enable-and-disable-alerts-on-a-service.",
DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool {
// Once migrated, alert_creation arguments previously defined as create_incidents would have been reported diffs for all matching services. As this is no longer configurable, opt to suppress this diff.
return true
},
ValidateDiagFunc: validateValueDiagFunc([]string{
"create_alerts_and_incidents",
"create_incidents",
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The following arguments are supported:
* `acknowledgement_timeout` - (Optional) Time in seconds that an incident changes to the Triggered State after being Acknowledged. Disabled if set to the `"null"` string. If not passed in, will default to '"1800"'.
* `escalation_policy` - (Required) The escalation policy used by this service.
* `response_play` - (Optional) The response play used by this service.
* `alert_creation` - (Optional) Must be one of two values. PagerDuty receives events from your monitoring systems and can then create incidents in different ways. Value "create_incidents" is default: events will create an incident that cannot be merged. Value "create_alerts_and_incidents" is the alternative: events will create an alert and then add it to a new incident, these incidents can be merged. This option is recommended.
* `alert_creation` - (Optional) (Deprecated) Values set for this field will no longer be considered due to the sunsetting of the Create Incidents Only feature. Moving forward, services will be using the Create Alerts and Incidents feature. Please remove use of this attribute as it will no longer be available in an upcoming major version.
* `alert_grouping` - (Optional) (Deprecated) Defines how alerts on this service will be automatically grouped into incidents. Note that the alert grouping features are available only on certain plans. If not set, each alert will create a separate incident; If value is set to `time`: All alerts within a specified duration will be grouped into the same incident. This duration is set in the `alert_grouping_timeout` setting (described below). Available on Standard, Enterprise, and Event Intelligence plans; If value is set to `intelligent` - Alerts will be intelligently grouped based on a machine learning model that looks at the alert summary, timing, and the history of grouped alerts. Available on Enterprise and Event Intelligence plan. This field is deprecated, use `alert_grouping_parameters.type` instead,
* `alert_grouping_timeout` - (Optional) (Deprecated) The duration in minutes within which to automatically group incoming alerts. This setting applies only when `alert_grouping` is set to `time`. To continue grouping alerts until the incident is resolved, set this value to `0`. This field is deprecated, use `alert_grouping_parameters.config.timeout` instead,
* `alert_grouping_parameters` - (Optional) Defines how alerts on this service will be automatically grouped into incidents. Note that the alert grouping features are available only on certain plans. If not set, each alert will create a separate incident.
Expand Down

0 comments on commit 57d5994

Please sign in to comment.