Skip to content

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

@mdb

Description

@mdb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions