terraform-provider-pagerduty
terraform-provider-pagerduty copied to clipboard
Add pagerduty_response_play datasource
- Add a pagerduty_response_play data source (fixes: #457)
This would be used as follows:
data "pagerduty_response_play" "this" {
name = "Response Play"
from = data.pagerduty_user.this.email
}
Then it'll be possible to reference the response play via data.pagerduty_response_play.this.id
, which would be needed for response adding a webUI created response play to a service, as some features are webUI only (e.g. Zoom conference bridge).
Questions:
- Should the from be on the data source? Or a default added to the provider?
ToDo
- [x] Add docs.
- [ ] Add tests.
@stmcallister I know I've not progressed this for some time, but do you have any idea if the from
for this API call should be on the provider or on the data source? That's part of the reason that I've not added docs or the completed tests.
@jjm The way we handled fields like this is to have the field in the resource (or data source, in this case) and then provide a DefaultFunc
value where an environment variable can be used if set. A good example is the resource_pagerduty_slack_connection and with the workspace_id.
I would recommend going this route for consistency. Thanks!
@stmcallister Apologies for the really late reply, I was just looking at doing this and it seems that response_play already has a from
field defined on the resource as I've done.
I'm wondering if it should be constant with response_play
resource?
I've added the missing docs, just need to look into adding the missing tests.
I don't have much time for open source work currently and we have stopped using response plays. So I'm just going to close this off.