This tool allows you to convert a list of users obtained from Amazon Cognito User Pools into a CSV format. You can retrieve the user list in JSON or TABLE format using the AWS CLI, and then use this tool to convert it into a CSV file.
You can use the AWS CLI to obtain the user list from Amazon Cognito User Pools. There are two output formats available:
To obtain the user list in JSON format, use the following AWS CLI command:
aws cognito-idp list-users --region <region> --user-pool-id <userPoolId> --output json > users.json
Replace with your AWS region code (e.g., us-east-1) and with the ID of your Cognito User Pool.
To obtain the user list in TABLE format, use the following AWS CLI command:
aws cognito-idp list-users --region <region> --user-pool-id <userPoolId> --output table > users.txt
Replace with your AWS region code (e.g., us-east-1) and with the ID of your Cognito User Pool.
-
Retrieve the user list from Amazon Cognito using the AWS CLI as explained above.
-
Save the JavaScript code into a file, e.g.,
convert.js
. -
Open a terminal, navigate to the folder containing
convert.js
andusers.json
, and run the script using Node.js:
node convert.js
The script will process the user list and create a users.csv file in the same folder.