1. Packages
  2. AWS Classic
  3. API Docs
  4. cognito
  5. getUserGroups

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

aws.cognito.getUserGroups

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

    Data source for managing AWS Cognito IDP (Identity Provider) User Groups.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.cognito.getUserGroups({
        userPoolId: "us-west-2_aaaaaaaaa",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cognito.get_user_groups(user_pool_id="us-west-2_aaaaaaaaa")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cognito.GetUserGroups(ctx, &cognito.GetUserGroupsArgs{
    			UserPoolId: "us-west-2_aaaaaaaaa",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Cognito.GetUserGroups.Invoke(new()
        {
            UserPoolId = "us-west-2_aaaaaaaaa",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cognito.CognitoFunctions;
    import com.pulumi.aws.cognito.inputs.GetUserGroupsArgs;
    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 example = CognitoFunctions.getUserGroups(GetUserGroupsArgs.builder()
                .userPoolId("us-west-2_aaaaaaaaa")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:cognito:getUserGroups
          Arguments:
            userPoolId: us-west-2_aaaaaaaaa
    

    Using getUserGroups

    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 getUserGroups(args: GetUserGroupsArgs, opts?: InvokeOptions): Promise<GetUserGroupsResult>
    function getUserGroupsOutput(args: GetUserGroupsOutputArgs, opts?: InvokeOptions): Output<GetUserGroupsResult>
    def get_user_groups(groups: Optional[Sequence[GetUserGroupsGroup]] = None,
                        user_pool_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetUserGroupsResult
    def get_user_groups_output(groups: Optional[pulumi.Input[Sequence[pulumi.Input[GetUserGroupsGroupArgs]]]] = None,
                        user_pool_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetUserGroupsResult]
    func GetUserGroups(ctx *Context, args *GetUserGroupsArgs, opts ...InvokeOption) (*GetUserGroupsResult, error)
    func GetUserGroupsOutput(ctx *Context, args *GetUserGroupsOutputArgs, opts ...InvokeOption) GetUserGroupsResultOutput

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

    public static class GetUserGroups 
    {
        public static Task<GetUserGroupsResult> InvokeAsync(GetUserGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetUserGroupsResult> Invoke(GetUserGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserGroupsResult> getUserGroups(GetUserGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:cognito/getUserGroups:getUserGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UserPoolId string
    User pool the client belongs to.
    Groups List<GetUserGroupsGroup>
    List of groups. See groups below.
    UserPoolId string
    User pool the client belongs to.
    Groups []GetUserGroupsGroup
    List of groups. See groups below.
    userPoolId String
    User pool the client belongs to.
    groups List<GetUserGroupsGroup>
    List of groups. See groups below.
    userPoolId string
    User pool the client belongs to.
    groups GetUserGroupsGroup[]
    List of groups. See groups below.
    user_pool_id str
    User pool the client belongs to.
    groups Sequence[GetUserGroupsGroup]
    List of groups. See groups below.
    userPoolId String
    User pool the client belongs to.
    groups List<Property Map>
    List of groups. See groups below.

    getUserGroups Result

    The following output properties are available:

    Id string
    User pool identifier.
    UserPoolId string
    Groups List<GetUserGroupsGroup>
    List of groups. See groups below.
    Id string
    User pool identifier.
    UserPoolId string
    Groups []GetUserGroupsGroup
    List of groups. See groups below.
    id String
    User pool identifier.
    userPoolId String
    groups List<GetUserGroupsGroup>
    List of groups. See groups below.
    id string
    User pool identifier.
    userPoolId string
    groups GetUserGroupsGroup[]
    List of groups. See groups below.
    id str
    User pool identifier.
    user_pool_id str
    groups Sequence[GetUserGroupsGroup]
    List of groups. See groups below.
    id String
    User pool identifier.
    userPoolId String
    groups List<Property Map>
    List of groups. See groups below.

    Supporting Types

    GetUserGroupsGroup

    Description string
    Description of the user group.
    GroupName string
    Name of the user group.
    Precedence int
    Precedence of the user group.
    RoleArn string
    ARN of the IAM role to be associated with the user group.
    Description string
    Description of the user group.
    GroupName string
    Name of the user group.
    Precedence int
    Precedence of the user group.
    RoleArn string
    ARN of the IAM role to be associated with the user group.
    description String
    Description of the user group.
    groupName String
    Name of the user group.
    precedence Integer
    Precedence of the user group.
    roleArn String
    ARN of the IAM role to be associated with the user group.
    description string
    Description of the user group.
    groupName string
    Name of the user group.
    precedence number
    Precedence of the user group.
    roleArn string
    ARN of the IAM role to be associated with the user group.
    description str
    Description of the user group.
    group_name str
    Name of the user group.
    precedence int
    Precedence of the user group.
    role_arn str
    ARN of the IAM role to be associated with the user group.
    description String
    Description of the user group.
    groupName String
    Name of the user group.
    precedence Number
    Precedence of the user group.
    roleArn String
    ARN of the IAM role to be associated with the user group.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi