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

pagerduty_alert_grouping_setting is not preserved when pagerduty_service is refreshed due to changes in the service. #958

Closed
nmistry24 opened this issue Dec 18, 2024 · 1 comment

Comments

@nmistry24
Copy link

Terraform Version

  • Terraform v1.10.2
  • PagerDuty v3.18.1

Affected Resource(s)

  • pagerduty_service
  • pagerduty_alert_grouping_setting

Terraform Configuration Files

resource "pagerduty_escalation_policy" "test_policy" {
  name      = "Test Alert Grouping Service Escalation Policy"
  rule {
    target {
      type = "user_reference"
      id   = "<USER_ID>"
    }
    escalation_delay_in_minutes = 1
  }
}

resource "pagerduty_service" "test_service" {
  name                    = "Test Service"
  escalation_policy       = pagerduty_escalation_policy.test_policy.id
}

resource "pagerduty_alert_grouping_setting" "test_alert" {
  name = "Test Alert Grouping Setting"
  type = "content_based"
  config {
    fields    = ["summary"]
    aggregate = "all"
  }
  services = [pagerduty_service.test_service.id]
}

Debug Output

GitHub Gist

Expected Behavior

pagerduty_service should only update the name accordingly and not make any changes to the pagerduty_alert_grouping_setting as there is no change there.

Actual Behavior

Error: Error reading: PDYWINC: PUT API call to https://api.pagerduty.com/services/PDYWINC failed 400 Bad Request. Code: 2001, Errors: [alert_grouping_parameters.config must be provided to enable content based grouping], Message: Invalid Input Provided
│
│   with pagerduty_service.test_service,
│   on test_service.tf line 12, in resource "pagerduty_service" "test_service":
│   12: resource "pagerduty_service" "test_service" {}
  • The change in service affects the newer alert grouping parameters and does not let any other changes to be made to the actual service.
  • I am making changes to the Support Hours dynamically to multiple services and am unable to make those critical implementations.

Steps to Reproduce

  1. terraform apply - Create a service with an escalation policy and the new alert grouping setting.
  2. Make changes to the pagerduty_service or pagerduty_escalation_policy.
  • Example: Changing the name of the service.
resource "pagerduty_service" "test_service" {
  name                    = "New Test Service"
  escalation_policy       = pagerduty_escalation_policy.test_policy.id
}
  1. terraform apply - The service would have to update the name and would show 1 change to be made.

References

GH-949

@nmistry24
Copy link
Author

Thanks @cjgajard for the update. The latest version of PagerDuty TF provider 3.18.3 has solved this issue for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant