AWS Amazon Cognito User Group

This page shows how to write Terraform and CloudFormation for Amazon Cognito User Group and write them securely.

aws_cognito_user_group (Terraform)

The User Group in Amazon Cognito can be configured in Terraform with the resource name aws_cognito_user_group. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L20
resource "aws_cognito_user_group" "reviewer" {
  name         = "reviewer"
  user_pool_id = aws_cognito_user_pool.main.id
}

resource "aws_cognito_user_group" "super-reviewer" {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a Cognito User Group resource.

AWS::Cognito::UserPoolGroup (CloudFormation)

The UserPoolGroup in Cognito can be configured in CloudFormation with the resource name AWS::Cognito::UserPoolGroup. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

cognito_userpool.yml#L62
    Type: AWS::Cognito::UserPoolGroup
    Properties:
      GroupName: BASIC
      UserPoolId: !Ref CognitoUserPool
      Description: Basic/free access to backend resources.
      Precedence: 30
serverless.yml#L31
      Type: AWS::Cognito::UserPoolGroup
      Properties:
        GroupName: Author
        UserPoolId:
          Ref: CognitoUserPoolCncb
    ManagerRole:
serverless.yml#L31
      Type: AWS::Cognito::UserPoolGroup
      Properties:
        GroupName: Author
        UserPoolId:
          Ref: CognitoUserPoolCncb
    ManagerRole:
cognito-user-pool.yml#L23
    Type: AWS::Cognito::UserPoolGroup
    Properties:
      GroupName: ${self:custom.studentUserGroupName}
      Description: A Student User
      Precedence: 3
      UserPoolId:
groups.yml#L2
    Type: "AWS::Cognito::UserPoolGroup"
    Properties:
      Description: "A user who is an admin"
      GroupName: "admin"
      Precedence: 0
      UserPoolId: !Ref UserPool
template.json#L45
          "Type" : "AWS::Cognito::UserPoolGroup",
          "Properties" : {
              "GroupName" : "Executive",
              "Precedence" : 1,

              "RoleArn" : {
template.json#L40
          "Type" : "AWS::Cognito::UserPoolGroup",
          "Properties" : {
              "GroupName" : "authors",
              "Precedence" : 1,

              "UserPoolId" : {
template.json#L40
          "Type" : "AWS::Cognito::UserPoolGroup",
          "Properties" : {
              "GroupName" : "admin",
              "Precedence" : 1,

              "UserPoolId" : {
template.json#L40
          "Type" : "AWS::Cognito::UserPoolGroup",
          "Properties" : {
              "GroupName" : "admin",
              "Precedence" : 1,

              "UserPoolId" : {
template.json#L40
          "Type" : "AWS::Cognito::UserPoolGroup",
          "Properties" : {
              "GroupName" : "user",
              "Precedence" : 1,

              "UserPoolId" : {

Parameters

Explanation in CloudFormation Registry

Specifies a new group in the identified user pool.

Calling this action requires developer credentials.

Frequently asked questions

What is AWS Amazon Cognito User Group?

AWS Amazon Cognito User Group is a resource for Amazon Cognito of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon Cognito User Group?

For Terraform, the nhsx/antibody-web source code example is useful. See the Terraform Example section for further details.

For CloudFormation, the Gilbertly/sls-starter-appsync, paullewallencom/javascript-978-1-7884-7041-4 and PacktPublishing/JavaScript-Cloud-Native-Development-Cookbook source code examples are useful. See the CloudFormation Example section for further details.