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

Actions and Conditions for rules that take arguments are failing validation #65

Closed
gone opened this issue May 12, 2020 · 1 comment
Closed

Comments

@gone
Copy link

gone commented May 12, 2020

The following rule fails validation:

resource "sentry_rule" "default" {
  depends_on = [sentry_project.default]
  organization = var.organization
  project = var.app_name
  name = "Send a notification for new events"
  action_match = "any"
  frequency    = 60

  conditions =   [
    {
      id = "sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"
    },
    {
      id = "sentry.rules.conditions.regression_event.RegressionEventCondition",
    },
    {
      id = "sentry.rules.conditions.reappeared_event.ReappearedEventCondition"
    },
    {
      interval = "1h"
      value = "1"
      id =  "sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition"
    }
  ]

  actions =  [
    {
      id = "sentry.mail.actions.NotifyEmailAction"
      target_type =  "IssueOwners"
      target_identifier = ""
    },
    {
      name = "Send a notification to the Lightmatter Slack workspace to #${var.app_name}-internal and show tags [] in notification"
      workspace = var.slack_workspace_id
      tags = "environment"
      id = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
      channel = "#${var.app_name}-internal"
    }
  ]
}

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

Removing the EventUniqueUserFrequencyCondition and NotifyEmailAction will fix the issue.

It's worth mentioning that the condition given in the documentation EG:

conditions = [
      {
        id       = "sentry.rules.conditions.event_frequency.EventFrequencyCondition"
        value    = 500
        interval = "1h"
      }
    ]

Will trigger the condition error as well.

@jianyuan
Copy link
Owner

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

2 participants