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

sentry_issue_alert action block - pagerduty service support #320

Closed
rajesh-dhakad opened this issue Aug 24, 2023 · 2 comments
Closed

sentry_issue_alert action block - pagerduty service support #320

rajesh-dhakad opened this issue Aug 24, 2023 · 2 comments

Comments

@rajesh-dhakad
Copy link

rajesh-dhakad commented Aug 24, 2023

For the "sentry_issue_alert" resource - how we can get the service id using the data source or any other way as the action block doesn't support service name.

│ Error: PUT https://sentry.io/api/0/projects/apolloio/staging/rules/14621324/: 400 map[actions:[Select a valid choice. Intelligence is not one of the available choices.]]

  actions = [
    {
      id = "sentry.integrations.pagerduty.notify_action.PagerDutyNotifyServiceAction"
      name = "Send a notification to PagerDuty account <account> and service <service>"
      account = data.sentry_organization_integration.pagerduty.id
      service = "Intelligence"
    }
  ]

I came across this but don't think this is the right way to do for terraform - #87 (comment)

@jianyuan
Copy link
Owner

Sentry has an official documentation for this now. Unfortunately, it's not very clear where the values come from. I will create some examples of how to configure this.

@jianyuan
Copy link
Owner

I have added an example here: https://registry.terraform.io/providers/jianyuan/sentry/latest/docs/resources/issue_alert#example-usage

#
# Send a PagerDuty notification
#

data "sentry_organization_integration" "pagerduty" {
  organization = sentry_project.test.organization

  provider_key = "pagerduty"
  name         = "PagerDuty"
}

resource "sentry_issue_alert" "pagerduty_alert" {
  actions = <<EOT
[
  {
    "id": "sentry.integrations.pagerduty.notify_action.PagerDutyNotifyServiceAction",
    "account": ${parseint(data.sentry_organization_integration.pagerduty.id, 10)},
    "service": 9823924
  }
]
EOT
  // ...
}

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