AWS v7.11.0 published on Wednesday, Nov 5, 2025 by Pulumi
aws.cognito.getUserGroups
Start a Neo task
Explain and create an aws.cognito.getUserGroups resource
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/v7/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(region: Optional[str] = None,
user_pool_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetUserGroupsResult
def get_user_groups_output(region: Optional[pulumi.Input[str]] = 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)
public static Output<GetUserGroupsResult> getUserGroups(GetUserGroupsArgs args, InvokeOptions options)
fn::invoke:
function: aws:cognito/getUserGroups:getUserGroups
arguments:
# arguments dictionaryThe following arguments are supported:
- User
Pool stringId - User pool the client belongs to.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- User
Pool stringId - User pool the client belongs to.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- user
Pool StringId - User pool the client belongs to.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- user
Pool stringId - User pool the client belongs to.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- user_
pool_ strid - User pool the client belongs to.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- user
Pool StringId - User pool the client belongs to.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
getUserGroups Result
The following output properties are available:
- Groups
List<Get
User Groups Group> - List of groups. See
groupsbelow. - Id string
- User pool identifier.
- Region string
- User
Pool stringId
- Groups
[]Get
User Groups Group - List of groups. See
groupsbelow. - Id string
- User pool identifier.
- Region string
- User
Pool stringId
- groups
List<Get
User Groups Group> - List of groups. See
groupsbelow. - id String
- User pool identifier.
- region String
- user
Pool StringId
- groups
Get
User Groups Group[] - List of groups. See
groupsbelow. - id string
- User pool identifier.
- region string
- user
Pool stringId
- groups
Sequence[Get
User Groups Group] - List of groups. See
groupsbelow. - id str
- User pool identifier.
- region str
- user_
pool_ strid
- groups List<Property Map>
- List of groups. See
groupsbelow. - id String
- User pool identifier.
- region String
- user
Pool StringId
Supporting Types
GetUserGroupsGroup
- Description string
- Description of the user group.
- Group
Name string - Name of the user group.
- Precedence int
- Precedence of the user group.
- Role
Arn string - ARN of the IAM role to be associated with the user group.
- Description string
- Description of the user group.
- Group
Name string - Name of the user group.
- Precedence int
- Precedence of the user group.
- Role
Arn string - ARN of the IAM role to be associated with the user group.
- description String
- Description of the user group.
- group
Name String - Name of the user group.
- precedence Integer
- Precedence of the user group.
- role
Arn String - ARN of the IAM role to be associated with the user group.
- description string
- Description of the user group.
- group
Name string - Name of the user group.
- precedence number
- Precedence of the user group.
- role
Arn 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.
- group
Name String - Name of the user group.
- precedence Number
- Precedence of the user group.
- role
Arn 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.
