Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.74 KB

README.md

File metadata and controls

45 lines (31 loc) · 1.74 KB

CircleCI Code Climate Code Climate Test Coverage

sinopia_user_backup

A Node application that backs up AWS Cognito user pools to AWS S3. The application stores backups in S3 with the following structure: {DATESTAMP}/user-backup_{TIMESTAMP}_{USER_POOL_ID}.json

Requires configuration via environment variables:

  • AWS_ACCESS_KEY_ID: The AWS access key associated with an account that has access to both Cognito and S3
  • AWS_SECRET_ACCESS_KEY: The AWS access secret associated with an account that has access to both Cognito and S3
  • AWS_REGION: The AWS region Cognito and S3 are running within
  • S3_BUCKET: The S3 bucket into which user backup data should be copied
  • COGNITO_USER_POOL_ID: The Cognito user pool to backup

Testing

A docker-compose configuration is included to mimic how the app would be run in a container-based production environment. To run the app, use:

# Add -d flag to run in the background
$ docker-compose up

Run the linter

$ npm run lint

Run unit tests

$ npm test

Build and push image

The CircleCI build is configured to perform these steps automatically on any successful build on the master branch. If you need to manually build and push an image, you can do this:

$ docker build -t ld4p/sinopia_user_backup:latest .
$ docker push ld4p/sinopia_user_backup:latest