In this section, you will create a Cognito User Pool using two methods:
Choose either method depending on your preference or environment.
This is the standard method using the AWS web interface.
Go to:
https://console.aws.amazon.com/cognito

My web app - Cognito

Select: Email (Users will log in using email addresses)
Required attributes:
Click Create user directory to fin
This option is useful if:
You want automation,
You are building IaC pipelines,
Or you prefer command-line setup.
aws cognito-idp create-user-pool \
--pool-name "my-userpool" \
--auto-verified-attributes email \
--username-attributes email
This command will:
Create a new user pool named my-userpool
Enable email as the username
Enable email auto-verification
Run:
aws cognito-idp create-user-pool-client \
--user-pool-id <YOUR_USERPOOL_ID> \
--client-name "my-app-client" \
--generate-secret \
--no-prevent-user-existence-errors \
--allowed-o-auth-flows-user-pool-client \
--allowed-o-auth-flows code \
--allowed-o-auth-scopes "email" "openid" \
--callback-urls "http://localhost:3000" \
--logout-urls "http://localhost:3000"
Replace:
<YOUR_USERPOOL_ID>
with the value returned from Step 1.
A successful creation returns JSON:
{
"UserPool": {
"Id": "ap-southeast-1_AbCdEf123",
"Name": "my-userpool"
}
}
And:
{
"UserPoolClient": {
"ClientId": "4ab5exampleid123",
"ClientSecret": "xyzexamplesecret"
}
}
Completed
You now have a fully configured Cognito User Pool created via:
AWS Console, or
AWS CLI
Navigation: