# CfnUserPoolUserToGroupAttachmentProps

Properties for defining a `CfnUserPoolUserToGroupAttachment`.

Used as props by: [CfnUserPoolUserToGroupAttachment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.CfnUserPoolUserToGroupAttachment.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 cfnUserPoolUserToGroupAttachmentProps: cognito.CfnUserPoolUserToGroupAttachmentProps = {
  groupName: 'groupName',
  username: 'username',
  userPoolId: 'userPoolId',
};
```

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_user_to_group_attachment_props = cognito.CfnUserPoolUserToGroupAttachmentProps(
    group_name="groupName",
    username="username",
    user_pool_id="userPoolId"
)
```

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.*;

CfnUserPoolUserToGroupAttachmentProps cfnUserPoolUserToGroupAttachmentProps = CfnUserPoolUserToGroupAttachmentProps.builder()
        .groupName("groupName")
        .username("username")
        .userPoolId("userPoolId")
        .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 cfnUserPoolUserToGroupAttachmentProps = new CfnUserPoolUserToGroupAttachmentProps {
    GroupName = "groupName",
    Username = "username",
    UserPoolId = "userPoolId"
};
```

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"

cfnUserPoolUserToGroupAttachmentProps := &CfnUserPoolUserToGroupAttachmentProps{
	GroupName: jsii.String("groupName"),
	Username: jsii.String("username"),
	UserPoolId: jsii.String("userPoolId"),
}
```

## Properties

- `groupName`: string | [IUserPoolGroupRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cognito.IUserPoolGroupRef.html) (required) — The name of the group that you want to add your user to.

- `username`: string | [IUserPoolUserRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cognito.IUserPoolUserRef.html) (required) — The user's username.

- `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 that contains the group that you want to add the user to.
