{"id":28635464,"url":"https://github.com/cruxstack/cognito-backup-restore-go","last_synced_at":"2026-01-18T01:01:15.073Z","repository":{"id":287207038,"uuid":"963516642","full_name":"cruxstack/cognito-backup-restore-go","owner":"cruxstack","description":"A CLI tool for backing up and restoring AWS Cognito user pool data.","archived":false,"fork":false,"pushed_at":"2026-01-14T16:46:23.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T19:59:47.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cruxstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-09T19:55:43.000Z","updated_at":"2026-01-14T16:46:02.000Z","dependencies_parsed_at":"2025-04-10T14:55:49.498Z","dependency_job_id":"f4035547-aec0-4f21-89a1-3ac1b481e9dc","html_url":"https://github.com/cruxstack/cognito-backup-restore-go","commit_stats":null,"previous_names":["cruxstack/cognito-backup-restore-go"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cruxstack/cognito-backup-restore-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fcognito-backup-restore-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fcognito-backup-restore-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fcognito-backup-restore-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fcognito-backup-restore-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cruxstack","download_url":"https://codeload.github.com/cruxstack/cognito-backup-restore-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fcognito-backup-restore-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28525420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"ssl_error","status_checked_at":"2026-01-18T00:39:39.467Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T17:10:28.007Z","updated_at":"2026-01-18T01:01:15.067Z","avatar_url":"https://github.com/cruxstack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cognito Backup Restore\n\n## What\n\nA CLI tool for backing up and restoring AWS Cognito user pool data.\n\n## Why\n\nAWS Cognito doesn't provide built-in backup/restore functionality. This tool\nlets you:\n\n- **Back up user data** from any Cognito user pool to a JSON file\n- **Restore users** to a pool from a backup file\n- **List user pools** in your AWS account for discovery\n\n## Usage\n\n### Installation\n\nDownload a pre-built binary from the\n[releases page](https://github.com/cruxstack/cognito-backup-restore-go/releases),\nor build from source:\n\n```bash\ngo build -o cbr .\n```\n\n### Prerequisites\n\n- Valid AWS credentials configured (via environment, shared credentials, or IAM role)\n- IAM permissions: `cognito-idp:ListUserPools`, `cognito-idp:ListUsers`, `cognito-idp:AdminCreateUser`\n\n### Commands\n\n**List user pools**\n\n```bash\ncbr list\n```\n\n**Back up users**\n\n```bash\ncbr backup --pool-id \u003cPOOL-ID\u003e --out \u003cFILE-PATH\u003e\n```\n\n| Flag        | Description                                              | Default       |\n| ----------- | -------------------------------------------------------- | ------------- |\n| `--pool-id` | The Cognito user pool ID                                 | **required**  |\n| `--out`     | Output file path for the backup                          | `backup.json` |\n| `--shard`   | Deterministic shard index/total (e.g., `1/3`, `2/3`)     | *(optional)*  |\n\n**Sharded backups**\n\nFor large user pools, you can run backups in parallel across multiple CI runners\nusing the `--shard` flag.\n\n```bash\n# Run 3 parallel backup jobs\ncbr backup --pool-id us-east-1_xxx --shard 1/3 --out backup.json  # outputs backup-1.json\ncbr backup --pool-id us-east-1_xxx --shard 2/3 --out backup.json  # outputs backup-2.json\ncbr backup --pool-id us-east-1_xxx --shard 3/3 --out backup.json  # outputs backup-3.json\n```\n\nSharding uses the user's `sub` attribute (UUID) prefix to deterministically\npartition users. Each shard only fetches its portion of users from AWS, enabling\ntrue parallel execution without coordination between runners. The output\nfilename is automatically suffixed with the shard index.\n\n**Restore users**\n\n```bash\ncbr restore --pool-id \u003cPOOL-ID\u003e --in \u003cFILE-PATH\u003e\n```\n\n| Flag        | Description                      | Default       |\n| ----------- | -------------------------------- | ------------- |\n| `--pool-id` | The Cognito user pool ID         | **required**  |\n| `--in`      | Input file path for the backup   | `backup.json` |\n\n---\n\n# Development\n\n## Project Structure\n\n```\n├── cmd/                  # CLI command definitions\n│   ├── backup.go\n│   ├── list.go\n│   ├── restore.go\n│   └── root.go\n├── internal/cognito/     # AWS Cognito client and operations\n│   ├── backup.go\n│   ├── client.go\n│   ├── list.go\n│   └── restore.go\n├── build/                # Build scripts\n└── main.go               # Entrypoint\n```\n\n## Building\n\n```bash\n# Local build\ngo build -o cbr .\n\n# Cross-platform builds (for releases)\n./build/build.sh v1.0.0\n```\n\n## Testing\n\n```bash\ngo test ./...\n```\n\n## Linting\n\n```bash\ngo vet ./...\ngofmt -l .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcruxstack%2Fcognito-backup-restore-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcruxstack%2Fcognito-backup-restore-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcruxstack%2Fcognito-backup-restore-go/lists"}