Open awendt opened 3 years ago
I expect this is happening on the server side at PagerDuty and not via Terraform, as being added to an escalation policy even via the WebUI results in this addition. The only way I've found around this is to add the user at as a responder (or manager) explicitly in Terraform so that you can remove the user from the team when removing from the escalation policy.
You'll also have issues on user removal if you don't manage all schedules via Terraform.
I think we have a variant of this issue. Because we were aware of the implicit change PagerDuty makes under the hood, adding users to a team if they're in a schedule, we manually add & remove users from teams using the pagerduty_team_membership
in a separately to pagerduty_schedule
.
However, even when doing this the provider will still try to remove pagerduty_team_membership
before adjusting the members in pagerduty_schedule
layers. Adding depends_on
to try and force the ordering doesn't seem to do anything either.
Hi there,
Terraform Version
0.12.28
Affected Resource(s)
pagerduty_escalation_policy
Terraform Configuration Files
Expected Behavior
Because
pagerduty_escalation_policy.ateam
implicitly creates a team membership forpagerduty_user.alice
andpagerduty_user.bob
, we expect the destruction of resourcepagerduty_escalation_policy.ateam
to clean up those implicitly created team memberships.Actual Behavior
The above configuration associates both
pagerduty_user.alice
andpagerduty_user.bob
with the teampagerduty_team.ateam
but fails to remove the association whenpagerduty_escalation_policy.ateam
is destroyed.This means the provider creates resources that are not reflected in state. The provider creates resources that are left dangling after resource destruction.
APIs should not have side effects (in this case, "associating people with teams"), or the side effects should be consistent on CREATE and DELETE.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
pagerduty_escalation_policy.ateam
from configurationterraform apply
References