# CfnUserPoolGroupProps

Properties for defining a `CfnUserPoolGroup`.

Used as props by: [CfnUserPoolGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.CfnUserPoolGroup.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cognito as cognito } from 'aws-cdk-lib';
const cfnUserPoolGroupProps: cognito.CfnUserPoolGroupProps = {
  userPoolId: 'userPoolId',

  // the properties below are optional
  description: 'description',
  groupName: 'groupName',
  precedence: 123,
  roleArn: 'roleArn',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cognito as cognito

cfn_user_pool_group_props = cognito.CfnUserPoolGroupProps(
    user_pool_id="userPoolId",

    # the properties below are optional
    description="description",
    group_name="groupName",
    precedence=123,
    role_arn="roleArn"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cognito.*;

CfnUserPoolGroupProps cfnUserPoolGroupProps = CfnUserPoolGroupProps.builder()
        .userPoolId("userPoolId")

        // the properties below are optional
        .description("description")
        .groupName("groupName")
        .precedence(123)
        .roleArn("roleArn")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Cognito;

var cfnUserPoolGroupProps = new CfnUserPoolGroupProps {
    UserPoolId = "userPoolId",

    // the properties below are optional
    Description = "description",
    GroupName = "groupName",
    Precedence = 123,
    RoleArn = "roleArn"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnUserPoolGroupProps := &CfnUserPoolGroupProps{
	UserPoolId: jsii.String("userPoolId"),

	// the properties below are optional
	Description: jsii.String("description"),
	GroupName: jsii.String("groupName"),
	Precedence: jsii.Number(123),
	RoleArn: jsii.String("roleArn"),
}
```

## Properties

- `description`: string — A description of the group that you're creating.

- `groupName`: string — A name for the group.

  This name must be unique in your user pool.

- `precedence`: number — A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool.

  Zero is the highest precedence value. Groups with lower `Precedence` values take precedence over groups with higher or null `Precedence` values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the `cognito:roles` and `cognito:preferred_role` claims.

  Two groups can have the same `Precedence` value. If this happens, neither group takes precedence over the other. If two groups with the same `Precedence` have the same role ARN, that role is used in the `cognito:preferred_role` claim in tokens for users in each group. If the two groups have different role ARNs, the `cognito:preferred_role` claim isn't set in users' tokens.

  The default `Precedence` value is null. The maximum `Precedence` value is `2^31-1` .

- `roleArn`: string | [IRoleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) — The Amazon Resource Name (ARN) for the IAM role that you want to associate with the group.

  A group role primarily declares a preferred role for the credentials that you get from an identity pool. Amazon Cognito ID tokens have a `cognito:preferred_role` claim that presents the highest-precedence group that a user belongs to. Both ID and access tokens also contain a `cognito:groups` claim that list all the groups that a user is a member of.

- `userPoolId`: string | [IUserPoolRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cognito.IUserPoolRef.html) (required) — The ID of the user pool where you want to create a user group.
