Skip to content

Instantly share code, notes, and snippets.

@brendanmckenzie
Created August 9, 2023 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendanmckenzie/2fee2bfc742b7492c0cef6cb4c8b033c to your computer and use it in GitHub Desktop.
Save brendanmckenzie/2fee2bfc742b7492c0cef6cb4c8b033c to your computer and use it in GitHub Desktop.
export list of users from cognito into csv
aws \
--output json \
cognito-idp \
list-users \
--user-pool-id __pool_id__ | \
jq -r \
'["id","email","name"], (.Users | .[] | [.Username, (.Attributes[] | select(.Name=="email") | .Value),(.Attributes[] | select(.Name=="name") | .Value)]) | @csv' \
> users.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment