Giter Site home page Giter Site logo

cognito-tool's Introduction

Table of Contents

npm version

cognito-tool

Amazon doesn't have any ways of backing up and restore heir AWS Cognito User Pools currently.

cognito-tool is a CLI for backing up and restoring the users. Note: AWS has no way of extracting the passwords of cognito users

This repo is forked from mifi/cognito-backup and added restore features. Package name is changed from cognito-backup to cognito-tool to adapt the new functions which are not only focus on backup tasks

Notes for cognito user restore

  1. When restoring, this tool sets the default password to P@ssw@rd1234 to all cognito users.
  2. Cognito user's sub (The UUID of the cognito user) is unique in aws globally. When restoring, the original sub can't be restored. New sub will be set when restoring.

Install

npm install -g cognito-tool

Usage

$ cognito-tool backup-users <user-pool-id> <options>  Backup all users in a single user pool

$ cognito-tool backup-all-users <options>  Backup all users in all user pools for this account

$ cognito-tool restore <user-pool-id> --file <JSON_users_file>  Restore users to user pool

Examples

Backup

$ cognito-tool backup-users eu-west-1_1_12345
$ cat eu-west-1_1_12345.json

$ cognito-tool backup-all-users eu-west-1_1_12345 --dir 20180326
$ cd 20180326
$ cat eu-west-1_1_12345.json

# Nominate region if not set in environment variable or ~/.aws/credentials
$ AWS_region=ap-southeast-2 cognito-tool backup-all-users ap-southeast-2_123456

Restore

$ cognito-tool restore ap-southeast-2_345678 --file eu-west-1_1_12345.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.