-
Notifications
You must be signed in to change notification settings - Fork 225
Description
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
pagerduty_teamshould return a list of members #345 (comment) claimsdata.pagerduty_usersenables querying team membership, but I don't believe it surfaces all details, as I describe above- Return a list of users for
pagerduty_team#346 attempts to add similar-ish functionality to thedata.pagerduty_teamdata source, but the implementation 1) does not surface member details beyondid(e.g. it still does not surface team role details) and 2) arguably over-tasks the data source in utilizing two different PagerDuty APIs.