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

Support for gracefully destroy pagerduty_schedule #561

Conversation

imjaroiswebdev
Copy link
Contributor

@imjaroiswebdev imjaroiswebdev commented Aug 23, 2022

Addresses #337, #358 and #534

This change is aimed to solve the recurring issue when trying to destroy a pagerduty_schedule resource which ends with the following error log...

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

Currently the pagerduty_schedule destroy implementation can't surpass the above mentioned error, because when a Schedule is being used by one or many Escalation Policies, it's needed to remove the schedule_reference targets from the Escalation Policies, and only after that is completed a graceful delete operation can be executed on the Schedule. So, this change includes the API calls for following previously explained flow.

Test Results...

Screen Shot 2022-08-23 at 18 29 40

Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great implementation for this issue! Nice work, @imjaroiswebdev!! 🌮 🎉 🍕

@nthienan
Copy link

when will this be released?

@imjaroiswebdev
Copy link
Contributor Author

when will this be released?

Hi @nthienan This fix was made available in v2.6.1 of PagerDuty Terraform Provider.

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

Successfully merging this pull request may close these issues.

3 participants