All Projects → rahulpsd18 → Cognito Backup Restore

rahulpsd18 / Cognito Backup Restore

Licence: mit
AIO Tool for backing up and restoring AWS Cognito User Pools

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Cognito Backup Restore

Cognito Express
Authenticates API requests on a Node application by verifying the JWT signature of AccessToken or IDToken generated by Amazon Cognito.
Stars: ✭ 165 (+16.2%)
Mutual labels:  aws, aws-cognito, cognito, amazon-cognito
Amplify Js
A declarative JavaScript library for application development using cloud services.
Stars: ✭ 8,539 (+5913.38%)
Mutual labels:  aws, aws-cognito, cognito, amazon-cognito
Aws Serverless Auth Reference App
Serverless reference app and backend API, showcasing authentication and authorization patterns using Amazon Cognito, Amazon API Gateway, AWS Lambda, and AWS IAM.
Stars: ✭ 724 (+409.86%)
Mutual labels:  aws, aws-cognito, cognito, amazon-cognito
aws-amplify-react-custom-ui
Building a Custom UI Authentication For AWS Amplify
Stars: ✭ 21 (-85.21%)
Mutual labels:  cognito, aws-cognito, amazon-cognito
Etcd Backup Restore
Collection of components to backup and restore the Etcd of a Kubernetes cluster
Stars: ✭ 99 (-30.28%)
Mutual labels:  aws, backup, restore
Aws Amplify Vue
A Vue.js starter app integrated with AWS Amplify
Stars: ✭ 359 (+152.82%)
Mutual labels:  aws, cognito, amazon-cognito
Aws Cognito Angular Quickstart
An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)
Stars: ✭ 685 (+382.39%)
Mutual labels:  aws, cognito, amazon-cognito
Amazon Cognito Identity Js
Amazon Cognito Identity SDK for JavaScript
Stars: ✭ 965 (+579.58%)
Mutual labels:  aws, aws-cognito, amazon-cognito
Auth Api Demo
Securing Microservices on AWS with Cognito, API Gateway and Lambda Demo
Stars: ✭ 140 (-1.41%)
Mutual labels:  aws, aws-cognito
Content Lambda Boto3
Automating AWS with Lambda, Python, and Boto3
Stars: ✭ 91 (-35.92%)
Mutual labels:  aws, backup
Aws Cli Cheatsheet
☁️ AWS CLI + JQ = Make life easier
Stars: ✭ 94 (-33.8%)
Mutual labels:  aws, cognito
Bareos Webui
Bareos Web User Interface
Stars: ✭ 78 (-45.07%)
Mutual labels:  backup, restore
Rdiffweb
A simplified backup management software for quick access to your archives through an efficient web interface.
Stars: ✭ 76 (-46.48%)
Mutual labels:  backup, restore
Cognitocurl
🦉🤖Easily sign curl calls to API Gateway with Cognito authorization token.
Stars: ✭ 76 (-46.48%)
Mutual labels:  aws, cognito
Conserve
[beta] robust portable backup tool in Rust
Stars: ✭ 107 (-24.65%)
Mutual labels:  backup, restore
Zmbackup
A reliable software written in Shell Script to help you in your daily task to backup and restore mails and accounts from Zimbra Open Source Email Platform. Project in deprecation process. Please help me with Waddles.
Stars: ✭ 103 (-27.46%)
Mutual labels:  backup, restore
Ixortalk.aws.cognito.jwt.security.filter
Spring Boot security filter for decoding Cognito JWT IdTokens
Stars: ✭ 75 (-47.18%)
Mutual labels:  aws, cognito
Pitrery
PostgreSQL Point In Time Recovery made easy
Stars: ✭ 99 (-30.28%)
Mutual labels:  backup, restore
Helicopterizer
Backup and Restore for Docker Container!
Stars: ✭ 112 (-21.13%)
Mutual labels:  backup, restore
Dynein
DynamoDB CLI written in Rust.
Stars: ✭ 126 (-11.27%)
Mutual labels:  aws, backup

cognito-backup-restore

All Contributors

AIO Tool for backing up and restoring AWS Cognito User Pools

Amazon Cognito is awesome, but has its own set of limitations. Currently there is no backup option provided in case we need to take backup of users (to move to another service) or restore them to new Userpool.

cognito-backup-restore tries to overcome this problem by providing a way to backup users from cognito pool(s) to json file and vice-versa.

Please Note: There is no way of getting passwords of the users in cognito, so you may need to ask them to make use of ForgotPassword to recover their account.

Requirements

Requires node 6.10 or newer

Installation

cognito-backup-restore is available as a package on npm.

npm install -g cognito-backup-restore

Usage

cognito-backup-restore can be used by importing it directly or via CLI (recommended).

Imports

Make sure you have installed it locally npm install --save cognito-backup-restore. Typings are available and included.

import * as AWS from 'aws-sdk';
import {backupUsers, restoreUsers} from 'cognito-backup-restore';

const cognitoISP = new AWS.CognitoIdentityServiceProvider();

// you may use async-await too
backupUsers(cognitoISP, <USERPOOL-ID>, <directory>)
  .then(() => console.log(`Backup completed`))
  .catch(console.error)

restoreUsers(cognitoISP, <USERPOOL-ID>, <JSON-File>, <Password?>)
  .then(() => console.log(`Restore completed`))
  .catch(console.error)

This is useful incase you want to write your own wrapper or script instead of using CLI.

CLI

Run cognito-backup-restore or cbr to use it. Make use of -h for help.

cbr <command> [options]

Available options are:

--region -r: The region to use. Overrides config/env settings

--userpool --pool: The Cognito pool to use. Possible value of all is allowed in case of backup.

--profile -p: Use a specific profile from the credential file. Key and Secret can be passed instead (see below).

--aws-access-key --key: The AWS Access Key to use. Not to be passed when using --profile.

--aws-secret-key --secret: The AWS Secret Key to use. Not to be passed when using --profile.

--delay: delay in millis between alternate users batch(60) backup, to avoid rate limit error.

--use-env-vars: Use AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN (optional) as environment variables

--use-ec2-metadata: Use credentials received from the metadata service on an EC2 instance

Image showing CLI Usage

  • Backup

    cbr backup
    cbr backup <options>
    

    --directory option is available to export json data to.

    GIF for using Backup CLI

  • Restore

    cbr restore
    cbr restore <options>
    

    --file option is available to read the json file to import from.

    --pwd option is available to set TemporaryPassword of the users. If not provided, cognito generated password will be used and email will be sent to the users with One Time Password.

    --pwdModule option is available to make use of custom logic to generate password. If not provided, cognito generated password will be used and email will be sent to the users with One Time Password, unless --pwd is used. Make sure to pass absolute path of the file. Refer this.

    GIF for using Restore CLI

In case any of the required option is missing, a interactive command line user interface kicks in to select from.

Todo

  • [X] Fine tune the backup process
  • [X] Implement Restore
  • [X] Write detailed Readme with examples
  • [ ] Convert JSON to CSV
  • [ ] Implement Amazon Cognito User Pool Import Job
  • [ ] AWS Cross-Region Cognito Replication

Contributors

Thanks goes to these wonderful people (emoji key):


adityamedhe-cc

📖 💻
🤔
Charlie Brown

🐛
💬
Vlad Korolev

💻

ashish kumar

📖 💻

ufoo68

💻

steveizzle

📖 💻

M. Holger

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].