How to backup Amazon Cognito? Amazon Cognito is a user management and authentication service provided by Amazon through Amazon Web Services:


  Amazon Cognito lets you easily add user sign-up and sign-in to your mobile and web apps. With Amazon Cognito, you also have the options to authenticate users through social identity providers such as Facebook, Twitter, or Amazon, with SAML identity solutions, or by using your own identity system. In addition, Amazon Cognito enables you to save data locally on users devices, allowing your applications to work even when the devices are offline. You can then synchronise data across users devices so that their app experience remains consistent regardless of the device they use.


What you are effectively doing is storing your customer data in a closed system hosted by Amazon.  If you are a company, such as a social network, who's data represents a significant asset within your organisation how to you ensure that this data is protected from:


Amazon Cognito being shut down unexpectedly, i.e. at request from a law enforcement or government agency.
Your access keys being compromised and some or all records being corrupted.
The relationship between your organisation and Amazon breaking down to the point Amazon withdraws all services with immediate effect.


Amazon Cognito is a huge benefit to organisations and developers as it takes a particularly hard piece of software and makes it easy to implement; from a service operability perspective, we need to find ways to mitigate, remediate or accept risks to the companies assets at all times.
The Amazon Cognito streams feature can be used to backup data.

Currently, Amazon does not provide a solution to backup their Cognito user Pools. You can use the following NPM package called "cognito-backup":

Install:

npm install -g cognito-backup


Usage

cognito-backup backup-users &lt;user-pool-id&gt; &lt;options&gt;  Backup all users in a single user pool
cognito-backup backup-all-users &lt;options&gt;  Backup all users in all user pools for this account


Examples

cognito-backup backup-users eu-west-1_1_12345
cognito-backup backup-users eu-west-1_1_12345 --region eu-west-1 --file mypool.json
cognito-backup backup-all-users eu-west-1_1_12345 --region eu-west-1 --dir output


Source: https://www.npmjs.com/package/cognito-backup