AWS::Cognito::UserPoolUserToGroupAttachment - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::Cognito::UserPoolUserToGroupAttachment

Adds a user to a group. A user who is in a group can present a preferred-role claim to an identity pool, and populates a cognito:groups claim to their access and identity tokens.

Note

Amazon Cognito evaluates Amazon Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Cognito::UserPoolUserToGroupAttachment", "Properties" : { "GroupName" : String, "Username" : String, "UserPoolId" : String } }

YAML

Type: AWS::Cognito::UserPoolUserToGroupAttachment Properties: GroupName: String Username: String UserPoolId: String

Properties

GroupName

The name of the group that you want to add your user to.

Required: Yes

Type: String

Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+

Minimum: 1

Maximum: 128

Update requires: Replacement

Username

The user's username.

Required: Yes

Type: String

Pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+

Minimum: 1

Maximum: 128

Update requires: Replacement

UserPoolId

The user pool ID for the user pool.

Required: Yes

Type: String

Pattern: [\w-]+_[0-9a-zA-Z]+

Minimum: 1

Maximum: 55

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns a generated ID, such as UserToGroupAttachment-YejJvzrEXAMPLE.

For more information about using the Ref function, see Ref.