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

Feature request: create pagerduty_team_members data source for reading team members' team roles #716

Closed
mdb opened this issue Jul 29, 2023 · 0 comments · Fixed by #717
Closed

Comments

@mdb
Copy link
Contributor

mdb commented Jul 29, 2023

Hi there,

Thanks for workin' on terraform-provider-pagerduty!

It would be useful if a data.pagerduty_team_members data source existed and featured a members attribute for reading a list of team members' user data. As a specific example, this would facilitate a mechanism through which each team member's team role (different from their user role) can be read, which doesn't currently exist.

According to resource.pagerduty_user documentation...

With advanced permissions, users can have both a user role (base role) and a team role. The team role can be configured in the pagerduty_team_membership resource.

While data.pagerduty_users supports fetching a list of users associated with the specified team_ids, each user in the resulting users only features a limited set of attributes (although, I've added additional attributes via PR #719 ). Furthermore, the data.pagerduty_users data source utilizes the list users API, which does not report the user's team role; only its user role.

This data.pagerduty_team_members could be the arguably-missing data source complement to resource.pagerduty_team_membership, as data.pagerduty_users doesn't quite suffice in surfacing all team membership user data, as I understand things.

Affected Resource(s)

Please list the resources as a list, for example:

  • data.pagerduty_team_members

Terraform Configuration Files

The following existing functionality enables reading team 123's members, but does not provide a mechanism for reading each team member's team role, most notably because it utilizes the list users API, which does not contain each user's team membership details:

data "pagerduty_users" "users" {
  team_ids = ["123"]
}

Feature request: Instead, a data.pagerduty_team_members data source could utilize the list team members API and return user membership details, including team role:

data "pagerduty_team_members" "members" {
  team_id = "123"
}

Expected Behavior

terraform-provider-pagerduty users can effectively retrieve team membership user data via a data source, including each member's team role.

Actual Behavior

terraform-provider-pagerduty have no mechanism for retrieving team membership user data -- such as each member's team role -- via a data source.

References

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

Successfully merging a pull request may close this issue.

1 participant