-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat: add pagerduty_event_orchestrations datasource #581
feat: add pagerduty_event_orchestrations datasource #581
Conversation
any updates ? |
4d7b9c1
to
fe26f68
Compare
Rebased to resolve conflicts; @imjaroiswebdev can you please review when able? Much appreciated |
Hi @fgouteroux - just for context, it would help if you could elaborate on the use case here. From your example in the doc: resource "pagerduty_event_orchestration" "tf_orch_a" {
name = "Test Event A Orchestration"
}
resource "pagerduty_event_orchestration" "tf_orch_b" {
name = "Test Event B Orchestration"
}
data "pagerduty_event_orchestrations" "tf_my_monitor" {
search = ".*Orchestration$"
} I'm presuming in your scenario that you might not know ahead of time that EOs (A & B) exist that might match |
Hello @gsreynolds , We need to get the integration keys in order to configure our alertmanager. We have a naming convention for the event orchestration (the owner team name in the name of EO). Today we have declare n datasources to get the event orchestration matching the exact name. Each datasource made a Pagerduty http call and it is useless to perform n call when we can do it once. At the end we need want to configure multiple alertmanager pagerduty_receivers, one for each integration_key.
With the datasource
I can retrieve all integration keys for myteam and then build a data map like this:
so I can automatically configure a pagerduty receiver for each integration key found. |
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.
Hi @fgouteroux I really appreciate your contribution and I'm also able to understand the value in this new data source you are introducing, however, I would ask you to first address a few comments I left as my review to proceed with its approval and merge. Thanks again! ✌🏽
Please don't hesitate in asking for help or if you need me to elaborate more on my comments. I'm also open to push the patches to cover my comments in order to accelerate the merge of this PR. You only have to let me know 💪🏽
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.
@fgouteroux Thanks for your use case and I understand better now
In my personal opinion, it seems not to be entirely in keeping with the declarative nature of Terraform. Still, I appreciate the scenario and acknowledge that “list” style resources exist elsewhere.
As @imjaroiswebdev has suggested, we would prefer to rename the attribute search
to name_filter
. If you look at similar “list” style data sources elsewhere they have a filter block for key/value pairs, but we only have a name (maybe team) here… For example:
registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones
registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/instances
c3b73fb
to
c304793
Compare
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.
All comments have been addressed ✌🏽
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 🚀
Awesome! Thank you @fgouteroux for adding this new data source and also @gsreynolds for all your help during the review, I really like the use case for this data source 💪🏽 🎉 |
Thank you @fgouteroux and @imjaroiswebdev! 🥳 |
Thank you so much for the review @gsreynolds and for your additional work @imjaroiswebdev ! |
Hey @fgouteroux and @gsreynolds this new Data Source you introduced in now available on PagerDuty Terraform Provider v2.10.0 Thank you! 🎉 💪🏽 🚀 |
Hello,
I want to add a new datasource pagerduty_event_orchestrations which allow to search multiples event_orchestration with a regex.
Example:
I added: