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

Feature: Add sentry_organization_pagerduty_service resource #296

Closed
wants to merge 11 commits into from

Conversation

sbrudz
Copy link

@sbrudz sbrudz commented Apr 13, 2023

This PR adds a sentry_organization_pagerduty_service resource. It handles a single service/integration key at a time, hiding the fact that the API requires POSTing a full list of all the services/integration keys. Any service/integration keys that aren't managed by terraform will be ignored and kept as-is.

The resource has the form:

resource "sentry_organization_integration_pagerduty" "this" {
  organization    = "my-organization"
  integration_id  = "org-integration-id"
  service_name    = "name-of-pagerduty-service"
  integration_key = "integration-key-from-pagerduty"
}

I've added integration tests that pass on my test instances of Sentry + PagerDuty. Since this requires paid plans for both services and I wasn't sure if the terraform-provider-sentry's test environment has this, I made the tests require the SENTRY_TEST_PAGERDUTY_INTEGRATION_ID environment variable to be set in order to run. Otherwise, the tests will be skipped.

This PR depends on changes to the underlying go-sentry library to be merged and released (jianyuan/go-sentry#80). Once that's merged, I'll update this PR and switch the status out of draft.

Fixes #250

@vodila-privet
Copy link

I think it will be cool!!!

@sbrudz sbrudz marked this pull request as ready for review April 14, 2023 19:16
@alexandrKuzmitsky
Copy link

Any further actions, guys?

@jmesquita
Copy link

We really want this to land soon, how can we get it to move forward?

@sbrudz sbrudz force-pushed the add_pagerduty_service_resource branch from 4a2c112 to 81041da Compare July 27, 2023 16:22
@sbrudz-orum
Copy link

I've resolved the merge conflict. It should be ready to go.

@rajesh-dhakad
Copy link

👍 We are waiting for this feature to be available.

@asibs
Copy link

asibs commented Feb 21, 2024

Also waiting for this feature. Without it you need to:

  1. Create a new PagerDuty Service and the PagerDuty side of the Sentry -> PagerDuty integration for the new PagerDuty Service (either in the PagerDuty UI, or using the PagerDuty Terraform module)
  2. Manually go into the Sentry UI and sync any new PagerDuty Services to the PagerDuty integration
  3. Use this Sentry Terraform provider to setup any alerts and push them to the relevant PagerDuty Service (either hardcoding the service integration id, or using some other mechanism to look it up such as making CURLs to the Sentry REST API)

The full process could be automated smoothly with this additional functionality in the Sentry module, so would be great to get it merged!

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

Successfully merging this pull request may close these issues.

Open to 'sentry_organization_pagerduty_service' resource?
8 participants