1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. cloudidentity
  5. getGroupMemberships
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.cloudidentity.getGroupMemberships

Explore with Pulumi AI

Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

Use this data source to get list of the Cloud Identity Group Memberships within a given Group.

https://cloud.google.com/identity/docs/concepts/overview#memberships

To get more information about GroupMembership, see:

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const members = gcp.cloudidentity.getGroupMemberships({
    group: "groups/123eab45c6defghi",
});
Copy
import pulumi
import pulumi_gcp as gcp

members = gcp.cloudidentity.get_group_memberships(group="groups/123eab45c6defghi")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/cloudidentity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudidentity.GetGroupMemberships(ctx, &cloudidentity.GetGroupMembershipsArgs{
			Group: "groups/123eab45c6defghi",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var members = Gcp.CloudIdentity.GetGroupMemberships.Invoke(new()
    {
        Group = "groups/123eab45c6defghi",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudidentity.CloudidentityFunctions;
import com.pulumi.gcp.cloudidentity.inputs.GetGroupMembershipsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var members = CloudidentityFunctions.getGroupMemberships(GetGroupMembershipsArgs.builder()
            .group("groups/123eab45c6defghi")
            .build());

    }
}
Copy
variables:
  members:
    fn::invoke:
      function: gcp:cloudidentity:getGroupMemberships
      arguments:
        group: groups/123eab45c6defghi
Copy

Using getGroupMemberships

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getGroupMemberships(args: GetGroupMembershipsArgs, opts?: InvokeOptions): Promise<GetGroupMembershipsResult>
function getGroupMembershipsOutput(args: GetGroupMembershipsOutputArgs, opts?: InvokeOptions): Output<GetGroupMembershipsResult>
Copy
def get_group_memberships(group: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetGroupMembershipsResult
def get_group_memberships_output(group: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetGroupMembershipsResult]
Copy
func GetGroupMemberships(ctx *Context, args *GetGroupMembershipsArgs, opts ...InvokeOption) (*GetGroupMembershipsResult, error)
func GetGroupMembershipsOutput(ctx *Context, args *GetGroupMembershipsOutputArgs, opts ...InvokeOption) GetGroupMembershipsResultOutput
Copy

> Note: This function is named GetGroupMemberships in the Go SDK.

public static class GetGroupMemberships 
{
    public static Task<GetGroupMembershipsResult> InvokeAsync(GetGroupMembershipsArgs args, InvokeOptions? opts = null)
    public static Output<GetGroupMembershipsResult> Invoke(GetGroupMembershipsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetGroupMembershipsResult> getGroupMemberships(GetGroupMembershipsArgs args, InvokeOptions options)
public static Output<GetGroupMembershipsResult> getGroupMemberships(GetGroupMembershipsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:cloudidentity/getGroupMemberships:getGroupMemberships
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Group
This property is required.
Changes to this property will trigger replacement.
string
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
Group
This property is required.
Changes to this property will trigger replacement.
string
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
group
This property is required.
Changes to this property will trigger replacement.
String
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
group
This property is required.
Changes to this property will trigger replacement.
string
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
group
This property is required.
Changes to this property will trigger replacement.
str
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
group
This property is required.
Changes to this property will trigger replacement.
String
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.

getGroupMemberships Result

The following output properties are available:

Group string
Id string
The provider-assigned unique ID for this managed resource.
Memberships List<GetGroupMembershipsMembership>
The list of memberships under the given group. Structure is documented below.
Group string
Id string
The provider-assigned unique ID for this managed resource.
Memberships []GetGroupMembershipsMembership
The list of memberships under the given group. Structure is documented below.
group String
id String
The provider-assigned unique ID for this managed resource.
memberships List<GetGroupMembershipsMembership>
The list of memberships under the given group. Structure is documented below.
group string
id string
The provider-assigned unique ID for this managed resource.
memberships GetGroupMembershipsMembership[]
The list of memberships under the given group. Structure is documented below.
group str
id str
The provider-assigned unique ID for this managed resource.
memberships Sequence[GetGroupMembershipsMembership]
The list of memberships under the given group. Structure is documented below.
group String
id String
The provider-assigned unique ID for this managed resource.
memberships List<Property Map>
The list of memberships under the given group. Structure is documented below.

Supporting Types

GetGroupMembershipsMembership

CreateTime This property is required. string
The time when the Membership was created.
Group This property is required. string
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
MemberKeys This property is required. List<GetGroupMembershipsMembershipMemberKey>
EntityKey of the member. Structure is documented below.
Name This property is required. string
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
PreferredMemberKeys This property is required. List<GetGroupMembershipsMembershipPreferredMemberKey>
EntityKey of the member. Structure is documented below.
Roles This property is required. List<GetGroupMembershipsMembershipRole>
The MembershipRoles that apply to the Membership. Structure is documented below.
Type This property is required. string
The type of the membership.
UpdateTime This property is required. string
The time when the Membership was last updated.
CreateTime This property is required. string
The time when the Membership was created.
Group This property is required. string
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
MemberKeys This property is required. []GetGroupMembershipsMembershipMemberKey
EntityKey of the member. Structure is documented below.
Name This property is required. string
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
PreferredMemberKeys This property is required. []GetGroupMembershipsMembershipPreferredMemberKey
EntityKey of the member. Structure is documented below.
Roles This property is required. []GetGroupMembershipsMembershipRole
The MembershipRoles that apply to the Membership. Structure is documented below.
Type This property is required. string
The type of the membership.
UpdateTime This property is required. string
The time when the Membership was last updated.
createTime This property is required. String
The time when the Membership was created.
group This property is required. String
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
memberKeys This property is required. List<GetGroupMembershipsMembershipMemberKey>
EntityKey of the member. Structure is documented below.
name This property is required. String
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
preferredMemberKeys This property is required. List<GetGroupMembershipsMembershipPreferredMemberKey>
EntityKey of the member. Structure is documented below.
roles This property is required. List<GetGroupMembershipsMembershipRole>
The MembershipRoles that apply to the Membership. Structure is documented below.
type This property is required. String
The type of the membership.
updateTime This property is required. String
The time when the Membership was last updated.
createTime This property is required. string
The time when the Membership was created.
group This property is required. string
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
memberKeys This property is required. GetGroupMembershipsMembershipMemberKey[]
EntityKey of the member. Structure is documented below.
name This property is required. string
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
preferredMemberKeys This property is required. GetGroupMembershipsMembershipPreferredMemberKey[]
EntityKey of the member. Structure is documented below.
roles This property is required. GetGroupMembershipsMembershipRole[]
The MembershipRoles that apply to the Membership. Structure is documented below.
type This property is required. string
The type of the membership.
updateTime This property is required. string
The time when the Membership was last updated.
create_time This property is required. str
The time when the Membership was created.
group This property is required. str
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
member_keys This property is required. Sequence[GetGroupMembershipsMembershipMemberKey]
EntityKey of the member. Structure is documented below.
name This property is required. str
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
preferred_member_keys This property is required. Sequence[GetGroupMembershipsMembershipPreferredMemberKey]
EntityKey of the member. Structure is documented below.
roles This property is required. Sequence[GetGroupMembershipsMembershipRole]
The MembershipRoles that apply to the Membership. Structure is documented below.
type This property is required. str
The type of the membership.
update_time This property is required. str
The time when the Membership was last updated.
createTime This property is required. String
The time when the Membership was created.
group This property is required. String
The parent Group resource under which to lookup the Membership names. Must be of the form groups/{group_id}.
memberKeys This property is required. List<Property Map>
EntityKey of the member. Structure is documented below.
name This property is required. String
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
preferredMemberKeys This property is required. List<Property Map>
EntityKey of the member. Structure is documented below.
roles This property is required. List<Property Map>
The MembershipRoles that apply to the Membership. Structure is documented below.
type This property is required. String
The type of the membership.
updateTime This property is required. String
The time when the Membership was last updated.

GetGroupMembershipsMembershipMemberKey

Id This property is required. string
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
Namespace This property is required. string
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
Id This property is required. string
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
Namespace This property is required. string
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. String
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. String
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. string
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. string
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. str
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. str
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. String
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. String
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.

GetGroupMembershipsMembershipPreferredMemberKey

Id This property is required. string
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
Namespace This property is required. string
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
Id This property is required. string
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
Namespace This property is required. string
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. String
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. String
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. string
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. string
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. str
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. str
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.
id This property is required. String
The ID of the entity. For Google-managed entities, the id is the email address of an existing group or user. For external-identity-mapped entities, the id is a string conforming to the Identity Source's requirements.
namespace This property is required. String
The namespace in which the entity exists. If not populated, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If populated, the EntityKey represents an external-identity-mapped group.

GetGroupMembershipsMembershipRole

ExpiryDetails This property is required. List<GetGroupMembershipsMembershipRoleExpiryDetail>
The MembershipRole expiry details, only supported for MEMBER role. Other roles cannot be accompanied with MEMBER role having expiry.
Name This property is required. string
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
ExpiryDetails This property is required. []GetGroupMembershipsMembershipRoleExpiryDetail
The MembershipRole expiry details, only supported for MEMBER role. Other roles cannot be accompanied with MEMBER role having expiry.
Name This property is required. string
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
expiryDetails This property is required. List<GetGroupMembershipsMembershipRoleExpiryDetail>
The MembershipRole expiry details, only supported for MEMBER role. Other roles cannot be accompanied with MEMBER role having expiry.
name This property is required. String
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
expiryDetails This property is required. GetGroupMembershipsMembershipRoleExpiryDetail[]
The MembershipRole expiry details, only supported for MEMBER role. Other roles cannot be accompanied with MEMBER role having expiry.
name This property is required. string
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
expiry_details This property is required. Sequence[GetGroupMembershipsMembershipRoleExpiryDetail]
The MembershipRole expiry details, only supported for MEMBER role. Other roles cannot be accompanied with MEMBER role having expiry.
name This property is required. str
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.
expiryDetails This property is required. List<Property Map>
The MembershipRole expiry details, only supported for MEMBER role. Other roles cannot be accompanied with MEMBER role having expiry.
name This property is required. String
The name of the MembershipRole. One of OWNER, MANAGER, MEMBER.

GetGroupMembershipsMembershipRoleExpiryDetail

ExpireTime This property is required. string

The time at which the MembershipRole will expire.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.

Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

ExpireTime This property is required. string

The time at which the MembershipRole will expire.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.

Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

expireTime This property is required. String

The time at which the MembershipRole will expire.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.

Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

expireTime This property is required. string

The time at which the MembershipRole will expire.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.

Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

expire_time This property is required. str

The time at which the MembershipRole will expire.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.

Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

expireTime This property is required. String

The time at which the MembershipRole will expire.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.

Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi