-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for attaching a Preset Alert to a View #26
Comments
Hi @wosteven Views can have one or more alerting "channels" attached to them, which I think is what you're after. Here's an example of a View that has an email alert channel configured: https://github.com/logdna/terraform-provider-logdna/blob/main/examples/view_with_email_alert.tf |
Hi @mdeltito , |
@wosteven we recently added the ability to consume For your provided example, the HCL implementation would look something like: resource "logdna_alert" "my_alert" {
name = "My Preset Alert via Terraform"
email_channel {
emails = ["[email protected]"]
immediate = "false"
operator = "presence"
triggerlimit = 15
triggerinterval = "15m"
terminal = "true"
timezone = "Pacific/Samoa"
}
}
data "logdna_alert" "my_alert_data" {
# the `logdna_alert` resource named my_alert will have its `id` attribute set upon successful creation
# so the data is being pulled directly from the remote backend rather than the local config args
presetid = logdna_alert.my_alert.id
}
resource "logdna_view" "my_view" {
name = "Basic View"
query = "level:debug my query"
# populate the relevant channel args by accessing the attribute from the preset alert data
email_channel = data.logdna_alert.my_alert_data.email_channel
...
} |
@david-ly It seems this does not work for slack channels?
|
I've also tried with
Might be that the whole preset attaching thing is broken at the moment? |
@mdeltito @david-ly What's the status on this. It's been this way for months and your documentation is certainly wrong. Is this a bug? I checked the code: the functionality was added and documented back in '21: c87a6cc The view's Might that be the issue? |
Hey !
How can i associate a view with an alert preset ?
I see that you can define a view and an alert separatly:
But how can i make "my_view" use "my_alert" ?
I would expect to see something like:
I did not find an attribute in logdna_view or logdna_alert that would support that ? Or do i miss something ?
The text was updated successfully, but these errors were encountered: