DEV Community

loading...

Adding Cognito Users with Admin APIs

jameson profile image Jameson ・1 min read

After you create a Cognito User Pool, you might want to add a user. You can do that through a mobile client or a webpage. However, it might be more convenient to do so via the CLI:

USERNAME=myusr11
PASSWORD=mypass99
POOL_ID=us-east-1_x5LZhWMsl # Not real

aws cognito-idp admin-create-user \
    --user-pool-id $POOL_ID \
    --username $USERNAME

aws cognito-idp admin-set-user-password \
    --user-pool-id $POOL_ID \
    --username $USERNAME \
    --password $PASSWORD \
    --permanent 

aws cognito-idp admin-confirm-sign-up \
    --user-pool-id $POOL_ID \
    --username $USERNAME 
Enter fullscreen mode Exit fullscreen mode

Discussion

pic
Editor guide