-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve circular dep problem by making trigger recipients lists their own type #262
Comments
Thanks for opening this issue, @jmhodges-color! We'll ponder this one a bit. In the interim, assuming you're on a new-enough version of Terraform the new-ish replace_triggered_by lifecycle argument might help? |
Unfortunately, Specifically, In our specific case, we're iterating over is a map of And, of course, The error from terraform is: |
Oh you know what, I just looked at our config and the API docs more closely and we're specifying I wonder if that's causing some of these problems? |
Ah, yes: the provider should do a better job of marking these ( I'm curious if you just switch to IDs (assuming you have them?) if the issue goes away? |
Yeah, so, my attempts to do that got a comment from a colleague saying we'd had to add the They said in their PR, when trying to change the recipient of a trigger:
Worse, the |
I suspect given the same issues are cropping up with with SLOs and columns, that the problem is not the |
I've made a separate ticket with a repro and an acceptance test because it seems that using just IDs doesn't make the problem go away. I believe there'll be cyclic dependency problems after we solve the id update problem described in #267, but I believe that's where we need to start. |
Is your feature request related to a problem? Please describe.
We had to rename the Slack channel a set of alerts went to today in terraform. That caused the original Slack channel recipient (call it
channelA
) to be deleted before the triggers had it removed from their list of recipients and that threw an error:Now, one non-working, terraform-only solution would be to require the triggers to be updated before the recipients with an explicit
depends_on
. But thatdepends_on
can't be added because when you're creating a brand new recipient you need it to exist before adding it to a trigger. A very common kind of circular dependency problem.So, you end up having to hunt down which triggers are using this recipient and manually remove them. (and, unfortunately, there's no search functionality for this and the web UX listing triggers truncates what recipients are included, so you have to get an admin to get you an API key to use the right API to find them. Doubly unfortunate: that API key will have write access because there's no way to get read-only recipients API access.)
Describe the solution you'd like
To solve this problem with only automated terraform work, it would be nice for the list of recipients of a trigger to be modeled as a separate resource akin to
okta_group_memberships
in okta-land (n.b.: I'm def talking about theokta_group_memberships
one, notokta_group_membership
).I've seen this work as a way to cut the knot of circular dependencies because the memberships object never needs to be deleted, just updated to have zero members associated with it.
Describe alternatives you've considered
Manually futzing with things when the
terraform apply
breaks.There may be some other terraform magicks that could be considered, but it would depend on the internal architecture of the provider (and I'm not super familiar with it)
The text was updated successfully, but these errors were encountered: