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

TaggedEventCondition not valid #62

Closed
neckhair opened this issue Apr 16, 2020 · 3 comments
Closed

TaggedEventCondition not valid #62

neckhair opened this issue Apr 16, 2020 · 3 comments

Comments

@neckhair
Copy link

neckhair commented Apr 16, 2020

The following sentry_rule condition returns a validation error.

conditions = [
    {
      id = "sentry.rules.conditions.tagged_event.TaggedEventCondition"
      key = "environment"
      match = "eq"
      value = "staging"
    }
  ]

Error: sentry: map[conditions:[Ensure at least one action is enabled and all required fields are filled in.]]

It looks like the underlying sentry client library doesn't support the match attribute, is that right?

@budgester
Copy link

budgester commented Apr 22, 2020

I think what you need in the rule is an action, as specified in the error message. "Ensure at least one action is enabled"

resource "sentry_rule" "test" {
    name = "Send a notification for new issues"
    organization = var.organization
    project = sentry_project.test.name
    action_match = "any"
    frequency    = 10
    conditions = [
      {
        id       = "sentry.rules.conditions.every_event.EveryEventCondition"
      }
    ]
    actions = [
      {
        id        = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
        channel   = var.test_channel
        name = "Send a notification via slack"
        label = "Send a slack notification"
        workspace = var.slack
        tags = "test"
      }
    ]
}

@zopz
Copy link

zopz commented Jul 22, 2021

FYI looks like this was a validation issue within the module that has since been fixed, see #65

@neckhair original formatting should work fine if you upgrade, ex.

resource "sentry_rule" "k8s_send_webhook" {
  organization = var.organization_name
  project      = "kubernetes"
  action_match = "any"
  frequency    = 5
  name         = "Notify when system OOM"

  actions = [
    {
      id = "sentry.rules.actions.notify_event.NotifyEventAction"
    }
  ]

  conditions = [
    {
      id    = "sentry.rules.conditions.tagged_event.TaggedEventCondition"
      key   = "reason"
      match = "eq"
      value = "SystemOOM"
    }
  ]
}

@jianyuan
Copy link
Owner

It looks this has been fixed. Let me know if the issue persists.

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

4 participants