AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.cognito.getUserGroups
Explore with Pulumi AI
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(user_pool_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetUserGroupsResult
def get_user_groups_output(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)
public static Output<GetUserGroupsResult> getUserGroups(GetUserGroupsArgs args, InvokeOptions options)
fn::invoke:
  function: aws:cognito/getUserGroups:getUserGroups
  arguments:
    # arguments dictionaryThe following arguments are supported:
- UserPool stringId 
- User pool the client belongs to.
- UserPool stringId 
- User pool the client belongs to.
- userPool StringId 
- User pool the client belongs to.
- userPool stringId 
- User pool the client belongs to.
- user_pool_ strid 
- User pool the client belongs to.
- userPool StringId 
- User pool the client belongs to.
getUserGroups Result
The following output properties are available:
- Groups
List<GetUser Groups Group> 
- List of groups. See groupsbelow.
- Id string
- User pool identifier.
- UserPool stringId 
- Groups
[]GetUser Groups Group 
- List of groups. See groupsbelow.
- Id string
- User pool identifier.
- UserPool stringId 
- groups
List<GetUser Groups Group> 
- List of groups. See groupsbelow.
- id String
- User pool identifier.
- userPool StringId 
- groups
GetUser Groups Group[] 
- List of groups. See groupsbelow.
- id string
- User pool identifier.
- userPool stringId 
- groups
Sequence[GetUser Groups Group] 
- List of groups. See groupsbelow.
- id str
- User pool identifier.
- user_pool_ strid 
- groups List<Property Map>
- List of groups. See groupsbelow.
- id String
- User pool identifier.
- userPool StringId 
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 awsTerraform Provider.