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

Open to 'sentry_organization_pagerduty_service' resource? #250

Closed
lingrino opened this issue Dec 22, 2022 · 5 comments · Fixed by #430
Closed

Open to 'sentry_organization_pagerduty_service' resource? #250

lingrino opened this issue Dec 22, 2022 · 5 comments · Fixed by #430

Comments

@lingrino
Copy link

👋 @jianyuan

Thank you for the great provider. I am hoping to use this provider to connect pagerduty services (which I already manage with terraform) with sentry. In the UI this is managed on the pagerduty integration settings page at https://sentry.io/settings/<orgid>/integrations/pagerduty/<integration-id>/.

I see there's already a similar resource sentry_organization_repository_github created in #204 to connect github repos to the github integration. Are you open to me creating a new PR for a resource sentry_organization_pagerduty_service that connects pagerduty services to the pagerduty integration? I should be able to make the whole PR but just wanted to make sure that's the right approach?

@jianyuan
Copy link
Owner

Hey @lingrino! Thank you for your kind words!

Here is what I think the DSL could look like:

resource "sentry_organization_integration_pagerduty" "default" {
  organization   = "my-organization"
  identifier     = "my-pager-duty-instance"

  service {
    name            = "service_1"
    integration_key = "00000000000000000000000000000000"
  }

  service {
    name            = "service_2"
    integration_key = "00000000000000000000000000000000"
  }
}

You may notice that the integration keys are nested in the same resource. Ideally, each should be its resource, but the API only accepts a complete list. The Terraform provider has to track the internal ids.

  1. https://github.com/getsentry/sentry/blob/6d6c0bd9b8125d554f966da1bb0b70fcab601c27/tests/sentry/integrations/pagerduty/test_integration.py#L146-L161
  2. https://github.com/getsentry/sentry/blob/6d6c0bd9b8125d554f966da1bb0b70fcab601c27/src/sentry/integrations/pagerduty/integration.py#L80-L114

I was planning to work on this next week. Happy to delegate it to you if you're keen on taking this on! Let me know!

@lingrino
Copy link
Author

@jianyuan sorry about the delay! I've got everything set up locally and I'm working on this now. Hopefully I will have a PR this week.

@lingrino
Copy link
Author

@jianyuan I'm sorry. Even though I'd love to work on this I don't think I'll find the time for at least a few weeks. If you were already planning on this resource then please continue without me. Otherwise I will check back in February

@gratus-acuitymd
Copy link

hi @jianyuan is this still on your roadmap? I am having the same issue as @lingrino - however I have never written GO so it would not be as easy for me to jump in and write this.

@sbrudz
Copy link

sbrudz commented Apr 13, 2023

We needed this functionality, too. I've submitted some PRs to add the resource.

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