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
resource "aws_cognito_user_group" "reviewer" {
name = "reviewer"
user_pool_id = aws_cognito_user_pool.main.id
}
resource "aws_cognito_user_group" "super-reviewer" {
Parameters
-
description
optional - string -
id
optional computed - string -
name
required - string -
precedence
optional - number -
role_arn
optional - string -
user_pool_id
required - string
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
Type: AWS::Cognito::UserPoolGroup
Properties:
GroupName: BASIC
UserPoolId: !Ref CognitoUserPool
Description: Basic/free access to backend resources.
Precedence: 30
Type: AWS::Cognito::UserPoolGroup
Properties:
GroupName: Author
UserPoolId:
Ref: CognitoUserPoolCncb
ManagerRole:
Type: AWS::Cognito::UserPoolGroup
Properties:
GroupName: Author
UserPoolId:
Ref: CognitoUserPoolCncb
ManagerRole:
Type: AWS::Cognito::UserPoolGroup
Properties:
GroupName: ${self:custom.studentUserGroupName}
Description: A Student User
Precedence: 3
UserPoolId:
Type: "AWS::Cognito::UserPoolGroup"
Properties:
Description: "A user who is an admin"
GroupName: "admin"
Precedence: 0
UserPoolId: !Ref UserPool
"Type" : "AWS::Cognito::UserPoolGroup",
"Properties" : {
"GroupName" : "Executive",
"Precedence" : 1,
"RoleArn" : {
"Type" : "AWS::Cognito::UserPoolGroup",
"Properties" : {
"GroupName" : "authors",
"Precedence" : 1,
"UserPoolId" : {
"Type" : "AWS::Cognito::UserPoolGroup",
"Properties" : {
"GroupName" : "admin",
"Precedence" : 1,
"UserPoolId" : {
"Type" : "AWS::Cognito::UserPoolGroup",
"Properties" : {
"GroupName" : "admin",
"Precedence" : 1,
"UserPoolId" : {
"Type" : "AWS::Cognito::UserPoolGroup",
"Properties" : {
"GroupName" : "user",
"Precedence" : 1,
"UserPoolId" : {
Parameters
-
GroupName
optional - String -
Description
optional - String -
UserPoolId
required - String -
Precedence
optional - Double -
RoleArn
optional - String
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.