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

Best practices on removing/adding persons for pagerduty_schedule objects

Open chenrui333 opened this issue 3 years ago • 4 comments

From time to time, when adding and removing folks for pagerduty_schedule objects seems always causing the schedule disruptions (I wonder if there is any guidelines of using pagerduty_schedule setup more correctly).

Personally, I think the issue is tied with how to properly use rotation_virtual_start and start fields for pagerduty_schedule objects.

cc @stmcallister

chenrui333 avatar Jun 01 '21 16:06 chenrui333

I'd be interested in this too -- CC @lnxchk in case you know of any good best practices here. The current UX is so difficult; we end up either doing date math or we have to ignore the schedule resources after create.

martinb3 avatar Jan 10 '22 18:01 martinb3

@martinb3 I'll ask around. What are you seeing? Is it leaving timeslots with no coverage, or something else?

lnxchk avatar Jan 10 '22 23:01 lnxchk

@lnxchk It's more of a UX thing than actual bugs.

From what I've seen, either with a significantly old start/rotation_virtual_start, or if even a schedule has been opened and saved without any changes in the UI -- basically any change to the schedule, it's very difficult to update Terraform config files and predict what the rotation changes will be. This is exacerbated by Terraform plan output where all the members of the schedule are opaque identifiers.

My experience has been that most teams at this point stop trying to figure out how to fix things in Terraform, and they'll go back just make their changes in the UI and then plan in Terraform, and just "fix" the Terraform files to undo any plan changes. And then the Terraform plan/apply ends up being a no-op.

It undermines IaC management of PagerDuty, when I've seen this place out.

martinb3 avatar Jan 11 '22 01:01 martinb3

I'm also interested in this best practice. Although we have an internal terraform module to manage on-call rotation, what I'm implementing to support removing/adding members are

  • Add a new layer whose rotation_virtual_start and start are a future date-time
  • Modify an existing layer's end to disable it at the future date-time

[UPDATED] I got stuck to unset the end time of a layer. I created https://github.com/PagerDuty/terraform-provider-pagerduty/issues/451 to show the details.

shotarok avatar Jan 21 '22 23:01 shotarok