-
Notifications
You must be signed in to change notification settings - Fork 212
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
Terraform unable to destroy and replace resources due to dependencies #534
Comments
Hi @elizajanus-ally the change aiming to solve this issue with |
@elizajanus-ally An update for fixing the issue related with deleting Schedules being used by Escalation Policies was merged on #561 and It has been released in version v2.6.1 of PagerDuty TF Provider, so updating to the new version hopefully You all would be able to gracefully delete Schedules without getting stuck with into this error. Please if You find any further issues related with this error after updating don't hesitate on reopening this Issue ✌🏽 |
@imjaroiswebdev there are still two use cases. one will be solved in #564 and one is when the schedule is the only remaining one in an escalation policy. |
Hi! I'm using provider version I have tried to explicit add the dependency in the schedule resource: resource "pagerduty_schedule" "primary" {
[...]
depends_on = [pagerduty_user.users, pagerduty_team_membership.team_membership] But I'm still getting the error below Error: DELETE API call to https://api.pagerduty.com/teams/P2A6JL1/users/PO21JXJ failed 400 Bad Request. Code: 2001, Errors: [User cannot be removed as they belong to an escalation policy on this team], Message: Invalid Input Provided |
Ping since experiencing the same thing as @deniojunior-hotmart. |
@imjaroiswebdev not sure if I should open a separate issue, but the same affects teams when you assign an escalation policy to a new team. |
Running into the same issue as @deniojunior-hotmart in a Despite adding explicit dependencies to the schedule & escalation policy resources, the user edit: @deniojunior-hotmart @bschaeffer I found a bit of a workaround by leveraging |
Terraform Version
v0.13.7
Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Expected Behavior
When I significantly change a resource, such as a schedule, Terraform forces the deletion and recreation of that resource. I expect that when I change a resource and Terraform attempts to destroy it, that operation will succeed because the provider would be aware of dependencies within resources, and delete the resources in an order that allows the operation to work.
Actual Behavior
When I significantly alter a schedule and Terraform tries to delete it, Terraform fails to delete the resource because of dependencies with escalation policies. When I try to remove a user from a team, that modification also fails due to dependencies with escalation policies.
Errors when attempting to replace schedules in Terraform and removing a user from a team:
The text was updated successfully, but these errors were encountered: