Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

589
Vistas
AWS Cognito delete all users from a user pool

How can we delete all users from a specific user pool in AWS Cognito using AWS CLI?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

try with below:

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
over 4 years ago · Santiago Trujillo Denunciar

0

Here is a bash version based on @ajilpm's batch script:

# deleteAllUsers.sh
COGNITO_USER_POOL_ID=$1

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

You must have jq installed and remember to make the script executable: chmod +x deleteAllUsers.sh.

The user pool id can be provided as a command line argument: ./deleteAllUsers.sh COGNITO_USER_POOL_ID.

over 4 years ago · Santiago Trujillo Denunciar

0

I created a script to do it from Windows CMD if you have AWS Cli installed and configured, which will delete all the users page by page, so you need to run it till all users are removed.

You need to have JQ downloaded and its path added to system env path for the following to work.

---delete.bat---

@echo off setlocal

for /f "delims=" %%I in 
  ('aws cognito-idp list-users --user-pool-id  $COGNITO_USER_POOL_ID ^| 
    jq -r ".Users | .[] | .Username"')
do 
  (aws cognito-idp admin-delete-user --user-pool-id $COGNITO_USER_POOL_ID --username %%I 
   echo %%I deleted)

---delete.bat---

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda