PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
204 stars 208 forks source link

Invalid API requests sent when updating a service that uses intelligent alert grouping #889

Closed grzegorzpro closed 2 weeks ago

grzegorzpro commented 2 weeks ago

It seems that the current provider version sends invalid requests to the API when updating a service that uses intelligent alert grouping. It is possible to create a service using the HCL pasted below, however, trying to perform any updates (e.g. changing service description) results in an error. This means it is not possible to update any service that uses intelligent alert grouping.

As far as I can tell, this is caused by the provider sending unnecessary fields in the alert_grouping_parameters.config field. If I remove timeout and aggregate from the request data, it gets processed correctly. Unfortunately, I was not able to find any Terraform resource configuration that would result in a correct request.

Terraform Version

Terraform v1.8.5 on linux_amd64

Affected Resource(s)

Terraform Configuration Files

resource "pagerduty_service" "service" {
  name = "Test service name"

  description       = "Test service description"
  escalation_policy = "P123456"

  alert_grouping_parameters {
    type = "intelligent"
  }
}

Debug Output

Error + trace related to the failing request: https://gist.github.com/grzegorzpro/4e738603c411c52176027f59616502d4

Expected Behavior

Apply should succeed

Actual Behavior

Error visible in the linked gist

Steps to Reproduce

  1. terraform apply to create the service
  2. Change description in the code
  3. terraform apply again
grzegorzpro commented 2 weeks ago

Well, seems I am late to the party, this issue has been fixed a couple of hours ago :)