Self-hosted API gateway for Claude Code on Amazon Bedrock
This guide covers how to upgrade CCAG to a new version, handle database migrations, and roll back if needed.
Check the currently deployed version:
# The image tag is the 8-character commit SHA
# Check what's running in ECS via the AWS console or:
aws ecs describe-services --cluster CCAG --services CCAG \
--query 'services[0].taskDefinition' --output text
Check for new releases on GitHub:
git fetch origin
git log HEAD..origin/main --oneline
Pre-built images are published to GitHub Container Registry on every release.
docker compose pull # Pull latest image from GHCR
docker compose up -d # Restart with new image
Set CCAG_VERSION in your .env file or pass it directly:
CCAG_VERSION=1.1.0 docker compose up -d
gh release list --repo antkawam/claude-code-aws-gateway
CDK deployments pull from GHCR by default. Deploy a specific release version:
cd infra
npx cdk deploy -c environment=prod -c imageTag=1.1.0
To review what changed between versions, check the release notes.
CCAG uses sqlx migrations stored in the migrations/ directory. Migrations are applied automatically on startup. No manual intervention is needed.
_sqlx_migrations table for already-applied migrationsConnect to the database and query:
SELECT version, description, installed_on, success
FROM _sqlx_migrations
ORDER BY version;
CCAG follows these principles for breaking changes:
When a breaking change is unavoidable, it will be documented in the release notes with migration instructions.
If an upgrade causes issues, you can roll back to a previous version.
The quickest rollback. Deploy a known-good image:
# Find the previous image tag (8-char commit SHA)
git log --oneline -5
# Deploy the previous image directly via CDK
cd infra
npx cdk deploy -c environment=prod -c imageTag=abcd1234
For immediate rollback without CloudFormation:
# Update the ECS service task definition directly (bypasses CDK)
# See infra/README.md for details on direct ECS task definition updates
This directly updates the ECS service task definition, bypassing CDK.
For a permanent rollback:
git revert HEAD
# Rebuild and redeploy (see infra/README.md for full deployment steps)
CCAG migrations are forward-only. If a migration introduced schema changes: