-
Notifications
You must be signed in to change notification settings - Fork 138
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
Control order of Alert Policies #223
Comments
@ffahri Sorry for bothering you. Can you help us with this or is the maintenance of this project somehow on-hold? |
I think #191 is similar. |
@axdotl Looking at the policy API doc, the order can't be set when creating/updating a policy but only through a specific request: https://docs.opsgenie.com/docs/alert-and-notification-policy-api#change-policy-order It's a bad API design leaded by the UI needs (you create the policy first, then change its order). Not sure if the clean Terraform way to handle this should be to hide the second request behind the same alert policy resource, or to create a specific "alert policy order" resource. Both looks dirty to me in their respective way, but as policies order may have a real impact on the result, I think it's important to fix this. |
@gdlx Thanks for this investigation. You're right it's again a situation where the Opsgenie API design is not that great. Based on your proposals I think the least dirty way is to introduce a new |
@axdotl I tended to agree but looking at the structure (long time since I coded for a TF provider), I think keeping a single resource (well, actually 2 with notification policies, but I'm not sure the order is as much important) may be better since there's no actual resource behind the change-order endpoint, so TF would have nothing with an ID to actually create/update/delete and store in the tfstate: at the end it's just a property in the policy itself. |
This is actually worse than I thought since, unlike the WebAPI, the Policy API used by Terraform does not provide the order in the policy data. |
At present, the GET Api https://docs.opsgenie.com/docs/alert-and-notification-policy-api#get-policy doesn't provide us the attribute of order. So we will not be able to support this request in terraform. |
1 similar comment
At present, the GET Api https://docs.opsgenie.com/docs/alert-and-notification-policy-api#get-policy doesn't provide us the attribute of order. So we will not be able to support this request in terraform. |
@agoel2-atlassian The order is provided by the policies list: https://docs.opsgenie.com/docs/alert-and-notification-policy-api#list-alert-policies That's what I've used in #388. Order has a strong impact on policies behavior. Not handling this almost prevents managing policies through terraform. |
@agoel2-atlassian would it be possible to reopen this issue? This is a significant blocker to us defining alert policies in Terraform and it seems like gdx' PR would address the use case. |
Looks like they closed it without even noting there's a PR fixing it. |
@agoel2-atlassian pinging again. #388 appears to address your concern, can you take a look? |
Hi there,
this is more a feature request than an issue report.
Terraform Version
0.14.3
Affected Resource(s)
Terraform Configuration Files
Debug Output
n/a
Panic Output
n/a
Expected Behavior
It would be great to have control about the policy order.
Policies retrieved from WebAPI
/webapi/policies
have an elementorder
.Actual Behavior
It is not possible to define the order of (global) policies. As a result, one has to sort the policies manually.
Steps to Reproduce
n/a
Important Factoids
n/a
References
n/a
The text was updated successfully, but these errors were encountered: