terraform-provider-pagerduty icon indicating copy to clipboard operation
terraform-provider-pagerduty copied to clipboard

`terraform apply` fails with Schedule can't be deleted if it's being used by an escalation policy snapshot with open incidents.

Open sgujavarthy opened this issue 7 months ago • 1 comments

Use case: Schedule can't be deleted if it's being used by an escalation policy snapshot with open incidents.

This is provider issue as terrafrom plan succeeds, but terraform apply fails with the following error message: Schedule can't be deleted if it's being used by an escalation policy snapshot with open incidents

Moreover, there is no useful error message to the user on how to get the list of those blocking incidents.

Terraform Version

terraform 1.1.5 PagerDuty Provider version: 3.12.1

Affected Resource(s)

  • pagerduty_schedule Actions: delete

Debug Output from Terrafrom Apply

Error: DELETE API call to https://api.pagerduty.com/schedules/P6LHGHQ failed 400 Bad Request. Code: 2001, Errors: [Schedule can't be deleted if it's being used by an escalation policy snapshot with open incidents], Message: Invalid Input Provided

Expected Behavior

What should have happened?

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Remove schedule from an escalation that has open incidents.
  2. Delete schedule HCL
  3. terraform plan
  4. terraform apply

sgujavarthy avatar Jul 09 '24 16:07 sgujavarthy