Skip to content

Latest commit

 

History

History
16 lines (9 loc) · 546 Bytes

delete_all_user_from_user_pool.md

File metadata and controls

16 lines (9 loc) · 546 Bytes

Delete all user from the Cognito user pool

Dependency

  1. aws cli & set up IAM config in home directory

  2. Install JQ

Command to delete all users

Replace the variable COGNITO_USER_POOL_ID with Pool Id in the following command

aws cognito-idp list-users --user-pool-id $COGNITO_USER_POOL_ID | jq -r '.Users | .[] | .Username' | while read uname1; do echo "Deleting $uname1"; aws cognito-idp admin-delete-user --user-pool-id $COGNITO_USER_POOL_ID --username $uname1; done