Last active
March 18, 2024 09:38
-
-
Save chrisdiana/cc7464d0624885dace587b08ced052e4 to your computer and use it in GitHub Desktop.
Export AWS Cognito User Pool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export as Text Table | |
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output table > ~/users.txt | |
# Export as JSON | |
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output json > ~/users.json | |
# Export User Pool with more than 60 users (pagination) | |
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --pagination-token INCREDIBLYLONGSTRINGHERE --output json > ~/users-2.json |
Thanks @mikhael28! I'll add this above.
Not sure that INCREDIBLYLONGSTRINGHERE
sufficiently conveys how long those strings are
This was exactly what I was looking for! Huge ups!
Also, the limit of 60 users seems to be gone. I exported 171 moments ago.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was money! It didn't export all the users in the user pool, but it was a good start! Cognito's ListUserAPI has a default limit of 60 accounts to list at a time, however it does give you a 'PaginationToken' which you can re-insert into the following CLI request, and export to a different file - user1.txt for example.
After the --user-pool-id, add in
--pagination-token INCREDIBLYLONGSTRINGHERE --output....
as usual until you export all your users.