Closed michelzanini closed 4 years ago
I am using version 0.5.1 of the provider, Terraform version 0.12.16
@michelzanini we'll take a look but have you reached out to Atlas support? Issues in this repo is for bugs per the README. If you can narrow down the issue with support first it helps a great deal, especially as alerts are some of the most complicated to track down due to the variations available. Also note Atlas API documentation for Alerts was updated recently so there may be some things in the Atlas API we were not able to account for and will have to adjust to match: https://docs.atlas.mongodb.com/reference/api/alert-configurations-create-config/
I can create the alert via API with a POST:
{
"enabled": true,
"eventTypeName": "REPLICATION_OPLOG_WINDOW_RUNNING_OUT",
"matchers": [],
"notifications": [
{
"delayMin": 0,
"intervalMin": 60,
"typeName": "PAGER_DUTY",
"serviceKey": "2f57fda20b70462bbf8001cfa7a1835a"
}
],
"threshold": {
"operator": "LESS_THAN",
"threshold": 1
}
}
From Terraform I can't define the threshold
block. I think this is missing...
Not sure why would I create a Atlas support ticket for this, but if you still want me to create I can. Please let me know. Thanks.
@michelzanini If you were able to set it via API directly but not via Terraform then no, you do not need a support ticket. The reason I mention support is they have the access and staffing to help (much more quickly and thoroughly) and narrow down potential bugs for the developers to address. In this case it seems you have done this on your own, thank you.
I'm assuming this is one that was left off due to the documentation being out of date. Now that the doc is caught up we'll need to improve the provider to match the Atlas reality. We'll update here when addressed.
@themantissa - Actually the documentation seems still not updated as I don't see threshold
block in there. Only metricThreshold
, which is supported by Terraform.
The reason why I knew how to create it is because I analysed the JSON that returns when doing a GET call.
Resuming - the docs are not up-to-date and so is not Terraform.
Maybe for that a support ticket is needed? Not sure...
Thanks.
@michelzanini indeed - I think you are correct. You've done quite a bit of work already. I'll get this sorted out from here on both sides. Thank you!
@michelzanini apologies for the length of time to resolution here but wanted to assure you and anyone else that we are working on this and will post updates as we have them.
End of week update: believe we've identified what we need to correct this in the provider. Should have what we need early/mid July and then will be able to determine when we can ensure the provider supports this correctly.
Hi @themantissa I'm using mongodbatlas provider version 0.6.3 and terraform version 0.13 and encountered the same errors when attempting to set event_type = "REPLICATION_OPLOG_WINDOW_RUNNING_OUT".
I have tried with:
"threshold": { "operator": "LESS_THAN", "threshold": 1 }
as well as:
metric_threshold = { operator = "LESS_THAN" threshold = 1.0 units = "HOURS" }
@jtmdb apologizes but we had to get a review and update of how to properly support Atlas alerts in Terraform with the underlying API. We have the information now and the work is on the work board but we have not yet gotten to it. We hope to soon but no firm ETA at this time, estimated currently in September.
Hello @jtmdb, I created a PR implementing the threshold attribute if you want to check more details or play with the new feature see the PR #298.
Let me know if you have another comment or concern, thanks
I can confirm the fix works after 0.6.4 release. Thanks!
Thank you @michelzanini! Very glad to hear that.
Hi,
I can't create a alert for
Replication Oplog Window is below 1 hours
using Terraform.This is what I have:
But this won't work as this alert needs a threshold. See error:
This threshold has a different JSON format than when using
OUTSIDE_METRIC_THRESHOLD
. ForOUTSIDE_METRIC_THRESHOLD
the JSON looks like this:But for this metric,
REPLICATION_OPLOG_WINDOW_RUNNING_OUT
, it looks like this:I tried using in Terraform:
But get this error:
And:
And get:
Is it possible that this metric is not support on Terraform right now, or how do I create it?
Thanks.