Overcast is alpha — behaviour and APIs may change between releases. Pin your version and read the changelog before upgrading.

overcast

Cognito examples

Import users from a real AWS user pool into a local one, by CLI or over HTTP, including the status mapping and what does not come across.

Worked examples past the Cognito quick start.

Import users from a real AWS pool

overcast import cognito-users \
  --from-pool-id us-east-1_abc123 \
  --to-pool-id us-east-1_def456 \
  --from-profile my-aws-profile \
  --batch-size 100
FlagDefaultDescription
--from-pool-id(req)Source user pool ID in real AWS
--to-pool-id(req)Target user pool ID in Overcast
--from-profileAWS profile for the source account
--from-regionAWS region (auto-detected if omitted)
--userImport a single user by sub (UUID)
--max-users0Limit total users (0 = unlimited)
--batch-size100Users per request to the server
--endpointOvercast daemon URL (inherited from the root command)

Important

Password hashes cannot be read out of AWS, so no password comes across. Every imported user that had one lands in FORCE_CHANGE_PASSWORD and must set a new password on first sign-in.

Status mapping

AWS statusBecomes
CONFIRMED, FORCE_CHANGE_PASSWORD, RESET_REQUIREDFORCE_CHANGE_PASSWORD
UNCONFIRMEDUNCONFIRMED
DISABLED, ARCHIVED, COMPROMISEDDISABLED
EXTERNAL_PROVIDERSkipped, and reported in errors

What comes across, and what does not

  • The original sub is preserved; any sub in the payload is overwritten.
  • Groups a user belongs to are auto-created as stubs if they are not already in the target pool.
  • Duplicate usernames are skipped and reported in errors.
  • No password, confirmation code or TOTP secret is imported.

Import over HTTP

The CLI is a wrapper around one endpoint, so a script or fixture loader can post users directly:

POST /_overcast/cognito/user-pools/{poolId}/import-users
Content-Type: application/json
{
  "users": [
    {
      "username": "jdoe",
      "sub": "a1b2c3d4-0000-0000-0000-000000000000",
      "enabled": true,
      "status": "CONFIRMED",
      "createdAt": "2024-01-01T00:00:00Z",
      "modifiedAt": "2024-01-01T00:00:00Z",
      "attributes": [{ "name": "email", "value": "jdoe@example.com" }],
      "groups": ["Admins"],
      "mfaEnabled": false
    }
  ]
}
{ "imported": 1, "skipped": 0, "errors": [] }