-
Notifications
You must be signed in to change notification settings - Fork 392
[datadog_integration_pagerduty_service_object] Add data source for pagerduty service objects #1773
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
base: master
Are you sure you want to change the base?
Conversation
…ting service name after 200 response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit
datadog/data_source_datadog_integration_pagerduty_service_object.go
Outdated
Show resolved
Hide resolved
…ct.go Co-authored-by: Heston Hoffman <[email protected]>
Hi @hestonhoffman @nkzou -- any updates on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Hi there, we've looked into the PR and we don't think the data source works as expected. The goal was to query the existence of the service object to avoid recreating it in a different terraform project/state, right? The given example code doesn't accomplish that, because the logic Moving forward we plan on changing the data source to one that returns a list of all pagerduty service objects, though I don't expect this to fit your use case either, since I believe this pattern goes against terraform's design. See hashicorp/terraform#23178 (comment). Could you share a bit more about your environment and use case? Multiple terraform states should not be attempting to manage a single object. Hopefully that all made sense and explains why we're not moving forward with the PR as it is now, let me know if I've misunderstood anything. |
That would still work for our use case but that looks like it would require a change in the API since it only allows for looking up a single integration.
We're distributing out a Terraform module for managing a PD service object in Pagerduty and then setting up the integration in Datadog. This standardizes the naming of these resources and allows us to also deterministically output the routing string (@pagerduty-*) for usage in their monitors. Our general setup is that each team/application maintains their own Terraform repository/state for their monitoring setup. But certain teams may want to define monitors in their codebase but route the alert to another's team Pagerduty service, so currently, they'll use the same module for creating the Pagerduty service/integration but pass a flag to the module to disable the creation of the service/integration to just get the routing string. This setup has caused confusion for people since it requires the users to know if a pagerduty integration already exists and pass in the flag to disable creation. |
Supersedes #1771, Original PR by @scemily13