terraform-provider-pagerduty icon indicating copy to clipboard operation
terraform-provider-pagerduty copied to clipboard

Add pagerduty_response_play datasource

Open jjm opened this issue 2 years ago • 4 comments

  • 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.

jjm avatar Mar 12 '22 17:03 jjm

@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 avatar Apr 22 '22 14:04 jjm

@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 avatar Apr 22 '22 23:04 stmcallister

@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?

jjm avatar Jun 30 '22 15:06 jjm

I've added the missing docs, just need to look into adding the missing tests.

jjm avatar Jun 30 '22 15:06 jjm

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.

jjm avatar Jul 24 '23 08:07 jjm