PagerDuty / terraform-provider-pagerduty

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

Best practices on removing/adding persons for pagerduty_schedule objects #341

Open chenrui333 opened 3 years ago

chenrui333 commented 3 years ago

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

martinb3 commented 2 years ago

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.

lnxchk commented 2 years ago

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

martinb3 commented 2 years ago

@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.

shotarok commented 2 years ago

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

[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.