AWS::Cognito::UserPoolUserToGroupAttachmentAdds 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. > Amazon Cognito evaluates AWS 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. > > **Learn more** - [Signing AWS API Requests](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html) > - [Using the Amazon Cognito user pools API and user pool endpoints](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html)
import { CfnUserPoolUserToGroupAttachment } from 'aws-cdk-lib/aws-cognito';Or use the module namespace:
import * as cognito from 'aws-cdk-lib/aws-cognito';
// cognito.CfnUserPoolUserToGroupAttachmentConfiguration passed to the constructor as CfnUserPoolUserToGroupAttachmentProps.
groupNameRequiredstring | IUserPoolGroupRefThe name of the group that you want to add your user to.
usernameRequiredstring | IUserPoolUserRefThe user's username.
userPoolIdRequiredstring | IUserPoolRefThe ID of the user pool that contains the group that you want to add the user to.
This L1 construct maps directly to the following CloudFormation resource type.
Everything you need to know about Amazon Cognito on one page. HD quality, print-friendly.
Download Free Infographicaws-cognitoAWS::Cognito::UserPoolUserToGroupAttachment