Table of Contents

About

A cognito User Pool is a Identity provider providing a user directory service to handle:

  • user registration,
  • authentication,
  • and account recovery.

A User Pool securely stores your users’ profile attributes.

Management

You can create and manage a User Pool using:

Creation

With the console:

  • console > Cognito under Mobile Services
  • Create user pool > UserPoolName > Review Defaults > Create
  • Note the pool Id. eu-central-1_7l0D9CCvP

With amplify cli in the project dir (doc)

amplify add auth
# then
amplify push
  • amplify add auth output example
Using service: Cognito, provided by: awscloudformation

 The current configured provider is Amazon Cognito.

 Do you want to use the default authentication and security configuration? Default configuration
 Warning: you will not be able to edit these selections.
 How do you want users to be able to sign in when using your Cognito User Pool? Email
 Warning: you will not be able to edit these selections.
 What attributes are required for signing up? (Press <space> to select, <a> to toggle all, <i> to invert selection)Email
Successfully added resource cognito49f48371 locally

Some next steps:
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud

  • amplify push output
Current Environment: dev

| Category | Resource name   | Operation | Provider plugin   |
| -------- | --------------- | --------- | ----------------- |
| Auth     | cognito49f48371 | Create    | awscloudformation |
? Are you sure you want to continue? Yes
/ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS bytle-site-dev-20190508103450 AWS::CloudFormation::Stack Wed May 08 2019 10:38:22 GMT+0200 (W. Europe Daylight Time) User Initiated
\ Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS authcognito49f48371 AWS::CloudFormation::Stack Wed May 08 2019 10:38:28 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS authcognito49f48371 AWS::CloudFormation::Stack Wed May 08 2019 10:38:29 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS bytle-site-dev-20190508103450-authcognito49f48371-1HYB2SXQ3JXMD AWS::CloudFormation::Stack Wed May 08 2019 10:38:29 GMT+0200 (W. Europe Daylight Time) User Initiated
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS SNSRole AWS::IAM::Role Wed May 08 2019 10:38:37 GMT+0200 (W. Europe Daylight Time)
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS SNSRole AWS::IAM::Role Wed May 08 2019 10:38:38 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
- Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE SNSRole AWS::IAM::Role Wed May 08 2019 10:38:56 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPool AWS::Cognito::UserPool Wed May 08 2019 10:39:02 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPool AWS::Cognito::UserPool Wed May 08 2019 10:39:07 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
| Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE UserPool AWS::Cognito::UserPool Wed May 08 2019 10:39:07 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClient AWS::Cognito::UserPoolClient Wed May 08 2019 10:39:12 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientWeb AWS::Cognito::UserPoolClient Wed May 08 2019 10:39:13 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPoolClient    AWS::Cognito::UserPoolClient Wed May 08 2019 10:39:15 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
CREATE_COMPLETE    UserPoolClient    AWS::Cognito::UserPoolClient Wed May 08 2019 10:39:15 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPoolClientWeb AWS::Cognito::UserPoolClient Wed May 08 2019 10:39:15 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
CREATE_COMPLETE    UserPoolClientWeb AWS::Cognito::UserPoolClient Wed May 08 2019 10:39:15 GMT+0200 (W. Europe Daylight Time)
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientRole AWS::IAM::Role Wed May 08 2019 10:39:20 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPoolClientRole AWS::IAM::Role Wed May 08 2019 10:39:21 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
| Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE UserPoolClientRole AWS::IAM::Role Wed May 08 2019 10:39:39 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientLambda AWS::Lambda::Function Wed May 08 2019 10:39:44 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPoolClientLambda AWS::Lambda::Function Wed May 08 2019 10:39:44 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
CREATE_COMPLETE    UserPoolClientLambda AWS::Lambda::Function Wed May 08 2019 10:39:44 GMT+0200 (W. Europe Daylight Time)
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientLambdaPolicy AWS::IAM::Policy Wed May 08 2019 10:39:49 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPoolClientLambdaPolicy AWS::IAM::Policy Wed May 08 2019 10:39:50 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
/ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE UserPoolClientLambdaPolicy AWS::IAM::Policy Wed May 08 2019 10:39:59 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientLogPolicy AWS::IAM::Policy Wed May 08 2019 10:40:04 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS UserPoolClientLogPolicy AWS::IAM::Policy Wed May 08 2019 10:40:05 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
- Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE UserPoolClientLogPolicy AWS::IAM::Policy Wed May 08 2019 10:40:14 GMT+0200 (W. Europe Daylight Time)
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientInputs Custom::LambdaCallout Wed May 08 2019 10:40:18 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS UserPoolClientInputs Custom::LambdaCallout Wed May 08 2019 10:40:22 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
- Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE    UserPoolClientInputs Custom::LambdaCallout      Wed May 08 2019 10:40:22 GMT+0200 (W. Europe Daylight Time)
CREATE_IN_PROGRESS IdentityPool         AWS::Cognito::IdentityPool Wed May 08 2019 10:40:27 GMT+0200 (W. Europe Daylight Time)
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS IdentityPool AWS::Cognito::IdentityPool Wed May 08 2019 10:40:29 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
CREATE_COMPLETE    IdentityPool AWS::Cognito::IdentityPool Wed May 08 2019 10:40:30 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS IdentityPoolRoleMap AWS::Cognito::IdentityPoolRoleAttachment Wed May 08 2019 10:40:36 GMT+0200 (W. Europe Daylight Time)
| Updating resources in the cloud. This may take a few minutes...

CREATE_IN_PROGRESS IdentityPoolRoleMap AWS::Cognito::IdentityPoolRoleAttachment Wed May 08 2019 10:40:38 GMT+0200 (W. Europe Daylight Time) Resource creation Initiated
CREATE_COMPLETE    IdentityPoolRoleMap AWS::Cognito::IdentityPoolRoleAttachment Wed May 08 2019 10:40:39 GMT+0200 (W. Europe Daylight Time)
- Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE bytle-site-dev-20190508103450-authcognito49f48371-1HYB2SXQ3JXMD AWS::CloudFormation::Stack Wed May 08 2019 10:40:42 GMT+0200 (W. Europe Daylight Time)
/ Updating resources in the cloud. This may take a few minutes...

CREATE_COMPLETE authcognito49f48371 AWS::CloudFormation::Stack Wed May 08 2019 10:40:46 GMT+0200 (W. Europe Daylight Time)
\ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE_CLEANUP_IN_PROGRESS bytle-site-dev-20190508103450 AWS::CloudFormation::Stack Wed May 08 2019 10:40:49 GMT+0200 (W. Europe Daylight Time)
UPDATE_COMPLETE                     bytle-site-dev-20190508103450 AWS::CloudFormation::Stack Wed May 08 2019 10:40:50 GMT+0200 (W. Europe Daylight Time)
√ All resources are updated in the cloud

Update

  • With amplify cli to update an Auth configuration in the project dir
amplify add auth
aws cognito-idp update-user-pool --user-pool-id "poolId" --admin-create-user-config "{""AllowAdminCreateUserOnly"": false, ""UnusedAccountValidityDays"": 6}"