PagerDuty / terraform-provider-pagerduty

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

Can not destroy pagerduty_schedule #658

Open brianbuda opened 1 year ago

brianbuda commented 1 year ago

Terraform Version

v1.4.2

Affected Resource(s)

Terraform Configuration Files

resource "pagerduty_team" "this" {
  name        = "test"
}
resource "pagerduty_schedule" "this" {
  time_zone = "America/New_York"
  layer {
    start                                = "2023-03-14T20:00:00-05:00"
    rotation_virtual_start               = "2023-03-15T20:00:00-05:00"
    rotation_turn_length_seconds         = 604800
    users                                = ["ABCD123"]
  }
  teams = [pagerduty_team.this.id]
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://gist.github.com/brianbuda/726089dd4f11b428ab33d258a0afca75

Panic Output

N/A

Expected Behavior

I can run terraform plan and terraform apply to create the resources successfully. When I run terraform destroy, the schedule says Still destroying before eventually timing out. The error that's posted is Error: timeout while waiting for state to become 'success' (timeout: 10s)

Actual Behavior

When I run the terraform destroy, the pagerduty schedule gets deleted.

Steps to Reproduce

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

  1. terraform plan
  2. terraform apply
  3. terraform destroy

Important Factoids

N/A

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

NargiT commented 1 year ago

delete schedule is a real mess when they get mixed with Teams.

this is what I get failed 400 Bad Request. Code: 6006, Errors: [Cannot delete team with existing Schedules association(s)], Message: Team has existing associations

why cannot we detroy a team and keep the schedule ? The amount of constraint in pager duty is insane and does not allow for propre gitops workflow. Instead the api encourage using the web version and do click click click billions of time.

Please make it work at scale !