{"id":45757607,"url":"https://github.com/aws-contrib/aws-aurora","last_synced_at":"2026-03-11T08:06:54.548Z","repository":{"id":308578506,"uuid":"1027512880","full_name":"aws-contrib/aws-aurora","owner":"aws-contrib","description":"Manage your AWS Aurora DSQL schema as code","archived":false,"fork":false,"pushed_at":"2026-03-07T05:58:23.000Z","size":883,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-07T13:39:49.079Z","etag":null,"topics":["aurora-dsql","aws","aws-aurora-dsql","cli","database-migrations","devcontainer","golang","infrastructure-as-code","postgresql","schema-migration"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-07-28T06:04:21.000Z","updated_at":"2026-03-07T05:58:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"a329e13d-b52f-463c-b6fc-569010766b15","html_url":"https://github.com/aws-contrib/aws-aurora","commit_stats":null,"previous_names":["aws-contrib/aurora","aws-contrib/aws-aurora"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aws-contrib/aws-aurora","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-contrib%2Faws-aurora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-contrib%2Faws-aurora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-contrib%2Faws-aurora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-contrib%2Faws-aurora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws-contrib","download_url":"https://codeload.github.com/aws-contrib/aws-aurora/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-contrib%2Faws-aurora/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30375621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: 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":["aurora-dsql","aws","aws-aurora-dsql","cli","database-migrations","devcontainer","golang","infrastructure-as-code","postgresql","schema-migration"],"created_at":"2026-02-25T21:13:57.331Z","updated_at":"2026-03-11T08:06:54.531Z","avatar_url":"https://github.com/aws-contrib.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aurora\n\n\u003e Schema migrations for AWS Aurora DSQL — because [Atlas doesn't support it yet](https://github.com/ariga/atlas/issues/3539).\n\n[![CI](https://github.com/aws-contrib/aws-aurora/actions/workflows/ci.yml/badge.svg)](https://github.com/aws-contrib/aws-aurora/actions/workflows/ci.yml)\n[![Release](https://github.com/aws-contrib/aws-aurora/actions/workflows/release.yml/badge.svg)](https://github.com/aws-contrib/aws-aurora/actions/workflows/release.yml)\n[![Latest Release](https://img.shields.io/github/v/release/aws-contrib/aws-aurora?sort=semver)](https://github.com/aws-contrib/aws-aurora/releases/latest)\n[![Coverage](https://raw.githubusercontent.com/aws-contrib/aws-aurora/main/.github/coverage.svg)](https://github.com/aws-contrib/aws-aurora/actions/workflows/ci.yml)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/aws-contrib/aws-aurora)](go.mod)\n[![Go Reference](https://pkg.go.dev/badge/github.com/aws-contrib/aws-aurora.svg)](https://pkg.go.dev/github.com/aws-contrib/aws-aurora)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![GHCR](https://img.shields.io/badge/container-ghcr.io-blue?logo=github)](https://github.com/aws-contrib/aws-aurora/pkgs/container/aws-aurora)\n\n`aurora` is a CLI tool that brings **schema-as-code migrations** to [AWS Aurora DSQL](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/what-is-aurora-dsql.html). It uses the same HCL config format as [Atlas](https://atlasgo.io/), handles distributed locking, generates IAM auth tokens automatically, and translates PostgreSQL index syntax to Aurora DSQL-compatible equivalents — so your local dev environment and production stay in sync.\n\n## Features\n\n- **Atlas-compatible HCL config** — familiar `env`, `variable`, and `data` blocks\n- **IAM token generation** — `data.aws_dsql_token` fetches a signed auth token at runtime\n- **Distributed locking** — prevents concurrent migrations across multiple replicas or CI runs\n- **Index syntax translation** — rewrites `CONCURRENTLY` to `ASYNC` automatically for Aurora DSQL\n- **Idempotent-first design** — each migration is safe to re-run; no drift surprises\n- **Multi-platform Docker image** — `linux/amd64` and `linux/arm64` published to GHCR\n\n## Quick Start\n\n### 1. Install\n\n**Docker (recommended)**\n\n```dockerfile\nFROM ghcr.io/aws-contrib/aws-aurora:edge AS aurora\nFROM scratch\n\nWORKDIR /app\nCOPY --from=aurora /bin/aurora /app/aurora\n```\n\n**From source**\n\n```bash\ngo install github.com/aws-contrib/aws-aurora/cmd/aurora@latest\n```\n\n### 2. Create a config file\n\nCreate `aurora.hcl` in your project root:\n\n```hcl\nenv \"aws\" {\n  migration {\n    dir = \"file://database/migration\"\n  }\n\n  url = \"postgres://${var.aws_dsql_username}:${urlescape(data.aws_dsql_token.this)}@${var.aws_dsql_host}/mydb\"\n}\n\ndata \"aws_dsql_token\" \"this\" {\n  username = var.aws_dsql_username\n  endpoint = var.aws_dsql_host\n  region   = var.aws_region\n}\n\nvariable \"aws_dsql_username\" {\n  type    = string\n  default = \"my-service\"\n}\n\nvariable \"aws_dsql_host\" {\n  type    = string\n  default = getenv(\"DATABASE_HOST\")\n}\n\nvariable \"aws_region\" {\n  type    = string\n  default = getenv(\"AWS_REGION\")\n}\n```\n\n### 3. Write migrations\n\nUse **Atlas** to generate migration files, then place them in your migrations directory (e.g. `database/migration/`).\n\n**Migrations must be idempotent** — Aurora DSQL does not allow a single transaction to contain multiple DDL and DML statements, and the CLI executes each statement individually. Write migrations so they can be safely re-applied:\n\n```sql\n-- Good: idempotent\nCREATE TABLE IF NOT EXISTS users (\n  id   UUID PRIMARY KEY,\n  name TEXT NOT NULL\n);\n\nALTER TABLE users ADD COLUMN IF NOT EXISTS email TEXT;\n```\n\n**Index creation** — use `CONCURRENTLY` locally (runs outside a transaction in PostgreSQL). The CLI translates it to `ASYNC` when running against Aurora DSQL:\n\n```sql\nCREATE INDEX CONCURRENTLY IF NOT EXISTS idx_users_email ON users (email);\n-- Becomes on Aurora DSQL:\n-- CREATE INDEX ASYNC IF NOT EXISTS idx_users_email ON users (email);\n```\n\n\u003e All SQL statements must end with `;` — the CLI splits migration files on semicolons.\n\n### 4. Apply migrations\n\n```bash\naurora migrate --env aws apply\n```\n\n### 5. Check migration status\n\n```bash\n# Show current status\naurora migrate --env aws status\n\n# Block until all pending migrations are applied (useful in CI/CD init containers)\naurora migrate --env aws status --wait --wait-timeout 10m\n```\n\n## CLI Reference\n\n```\naurora migrate [flags] \u003ccommand\u003e\n\nFlags:\n  --config  Path to config file (default: file://aurora.hcl)\n  --env     Environment name from config (required)\n\nCommands:\n  apply   Apply all pending migrations\n  status  Show migration status\n\napply flags:\n  --lock-timeout  How long to wait for the distributed lock (default: 25m)\n\nstatus flags:\n  --wait          Block until no pending migrations remain\n  --wait-timeout  Maximum time to wait (default: 25m)\n```\n\n## Development\n\nThis project ships with a [Dev Container](https://containers.dev/) that includes Go, PostgreSQL, and all recommended VS Code extensions.\n\n```bash\n# Open in VS Code with Dev Containers extension installed\ncode .\n# Then: Reopen in Container\n```\n\nOnce inside the container, a local PostgreSQL instance is available at `127.0.0.1:5432` and `$AURORA_DATABASE_URL` is set automatically.\n\n```bash\n# Run tests\ngo tool ginkgo -r\n\n# Run tests with coverage\ngo tool ginkgo -r -coverprofile=coverprofile.out\n```\n\n## Contributing\n\nContributions are welcome. Please open an issue before submitting a pull request for significant changes.\n\n1. Fork the repo and create a feature branch\n2. Write tests for new behaviour\n3. Ensure `go tool ginkgo -r` passes\n4. Open a PR — the CI pipeline will run tests automatically\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-contrib%2Faws-aurora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-contrib%2Faws-aurora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-contrib%2Faws-aurora/lists"}