PagerDuty / terraform-provider-pagerduty

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

:new: Support Dynamic Routing #878

Open NargiT opened 4 weeks ago

NargiT commented 4 weeks ago

It's still in early access, but I would love to see this supported.

image image

NargiT commented 3 weeks ago

Migration issue

:information_source: Right now the interface allow to add a dynamic or static routing even if there are existing rules.

image

But terraform use an api that does not allow it.

│ Error: PUT API call to https://api.eu.pagerduty.com/event_orchestrations/167e5733-a62b-49ff-9008-50d498bff948/router failed 400 Bad Request. Code: 0, Errors: map[sets:[map[rules:[map[actions:map[route_to:[route_to and dynamic_route_to are mutually exclusive actions in Router rules]]] map[] map[] map[] map[]]]]], Message: Invalid payload
│ 
│   with pagerduty_event_orchestration_router.event_orchestration_router_nagios_prod,
│   on auto-orchestration-router-nagios.tf line 1, in resource "pagerduty_event_orchestration_router" "event_orchestration_router_nagios_prod":
│    1: resource "pagerduty_event_orchestration_router" "event_orchestration_router_nagios_prod" {

Because other wise, we need to do 2 steps instead of one to migrate.

  1. delete all rules wait....
  2. add the new one wait...

This is not acceptable from operation point of view as it can lead to miss event between step 1 and 2.