Skip to content
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

Attaching alert while creating view does not work as documented #47

Open
philippfrank opened this issue May 4, 2022 · 3 comments
Open

Comments

@philippfrank
Copy link

This does not work (1.8.0):

https://github.com/logdna/terraform-provider-logdna/blame/main/docs/data-sources/logdna_alert.md#L80

│ Error: Unsupported argument
│
│   on main.tf line 101, in resource "logdna_view" "test":
│  101:   slack_channel = data.logdna_alert.test_alert.slack_channel
│
│ An argument named "slack_channel" is not expected here. Did you mean to define a block of
│ type "slack_channel"?
@jakedipity
Copy link
Contributor

Looks like we need to update our documentation. The correct way to fill in a block from a source is with a dynamic block e.g.

resource "logdna_view" "test" {
  name  = "Basic View"
  query = "level:debug my query"
  dynamic email_channel {
    for_each = data.logdna_alert.external_remote.email_channel
    content {
      immediate       = email_channel.value["immediate"]
      operator        = email_channel.value["operator"]
      terminal        = email_channel.value["terminal"]
      triggerinterval = email_channel.value["triggerinterval"]
      triggerlimit    = email_channel.value["triggerlimit"]
      emails          = email_channel.value["emails"]
    }
  }
}

@philippfrank
Copy link
Author

philippfrank commented May 9, 2022

@jakedipity - yes, that works - thank you. Please update the docs, other folks were having the same or related issues:

cc
#44
#26

@selva-krishnan
Copy link

@philippfrank - This fix does not attach the preset to the view. Instead, it creates as a view specific alert. I was expecting to see something like a preset and used by multiple views in the LogDNA UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants