Open sterfield opened 3 years ago
@stmcallister is this going to be addressed? We too are getting into this permanent diff (code deviating from actual state)
Hit this issue today. For anyone else experiencing this, take a look at https://community.pagerduty.com/forum/t/how-to-remove-a-team-that-has-an-associated-schedule/2117/2
Terraform Version
1.0.5
Affected Resource(s)
pagerduty_schedule
A recent PR allowed to add
teams
to apagerduty_schedule
.However, if you look at the documentation, the API is reacting in two different ways:
Documentation states also that if you "like to assign a team to your schedule, add your schedule to an escalation policy and then add that escalation policy to your team."
The API is also showing a
teams
object you can feed for a POST or a PUT, even if it will be ignored in the latter.Expected Behavior
Having
No Changes
from Terraform if you modify a schedule with teams that are not already attached to the said schedule.Actual Behavior
Terraform will always try to add / remove teams according to what is written in the code on an already-existing schedule, but as the API doesn't allow it to do any modification regarding teams, it'll always report permanent diff.
Steps to Reproduce
pagerduty_schedule
without any teamsterraform plan
. It'll want to remove the teamterraform apply
. It'll be successfulterraform plan
, it'll still want to remove the teamImportant Factoids
I realised that the problem relies more on the Pagerduty API that have a different behavior between a POST and a PUT, but the direct consequence is that many users will face a permanent diff OR will have to constantly update the
teams
parameter in theirpagerduty_schedule
in order to have a stable plan.References
368
Thanks for your help !