# CLI export & import tool for users & groups AWS Cognito Pool

**Robust `export-import-user-pool-users` script which can:**

- export users, groups and connection between them from Cognito Pool into 3 separate
- import users to Cognito Pool
- import groups to Cognito Pool
- assign users within groups

## Installation
```
pip install export-import-user-pool-users
```

## Syntax

### export

Without specify filenames, export switch `-e` creates 3 files:
- [cognitoPoolId]-users.csv
- [cognitoPoolId]-groups.csv
- [cognitoPoolId]-maps.csv

Options `-r` & `-c` are required for both export and import.

```
$ export-import-user-pool-users -r `region` -c `cognitoPoolId` -e
```

- **-f** - file name for users CSV
- **-g** - file name for grups CSV
- **-m** - file name for map users - groups CSV

## import

While import, besides `-r` and `-c` switches script requires
at least one of `-f`, `-g`, `-m` according to expected behavior.

```
$ export-import-user-pool-users -r `region` -c `cognitoPoolId` -i -f usersFile.csv -g groupsFile.csv -m usersGroupsMappingFile.csv
```
