UserPoolGroupOptions Struct
Options to create a UserPoolGroup.
| Source | aws-cognito/lib/user-pool-group.ts |
|---|---|
| Type last changed |
Example
declare const userPool: cognito.UserPool;
declare const role: iam.Role;
new cognito.UserPoolGroup(this, 'UserPoolGroup', {
userPool,
groupName: 'my-group-name',
precedence: 1,
role, // assign IAM Role
});
// You can also add a group by using addGroup method.
userPool.addGroup('AnotherUserPoolGroup', {
groupName: 'another-group-name'
});
# user_pool: cognito.UserPool
# role: iam.Role
cognito.UserPoolGroup(self, "UserPoolGroup",
user_pool=user_pool,
group_name="my-group-name",
precedence=1,
role=role
)
# You can also add a group by using addGroup method.
user_pool.add_group("AnotherUserPoolGroup",
group_name="another-group-name"
)
UserPool userPool;
Role role;
UserPoolGroup.Builder.create(this, "UserPoolGroup")
.userPool(userPool)
.groupName("my-group-name")
.precedence(1)
.role(role)
.build();
// You can also add a group by using addGroup method.
userPool.addGroup("AnotherUserPoolGroup", UserPoolGroupOptions.builder()
.groupName("another-group-name")
.build());
// Install: dotnet add package Amazon.CDK.Lib
UserPool userPool;
Role role;
new UserPoolGroup(this, "UserPoolGroup", new UserPoolGroupProps {
UserPool = userPool,
GroupName = "my-group-name",
Precedence = 1,
Role = role
});
// You can also add a group by using addGroup method.
userPool.AddGroup("AnotherUserPoolGroup", new UserPoolGroupOptions {
GroupName = "another-group-name"
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var userPool UserPool
var role Role
cognito.NewUserPoolGroup(this, jsii.String("UserPoolGroup"), &UserPoolGroupProps{
UserPool: UserPool,
GroupName: jsii.String("my-group-name"),
Precedence: jsii.Number(1),
Role: Role,
})
// You can also add a group by using addGroup method.
userPool.addGroup(jsii.String("AnotherUserPoolGroup"), &UserPoolGroupOptions{
GroupName: jsii.String("another-group-name"),
})
Properties
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #Default: no description
groupNameoptionalstringgroup_nameoptionalstrgroupNameoptionalStringGroupNameoptionalstringGroupNameoptional*string #Default: auto generate a name
Must be unique.
precedenceoptionalnumberprecedenceoptionalint | floatprecedenceoptionalNumberPrecedenceoptionaldoublePrecedenceoptional*float64 = null #notes
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.