Skip to main content
The AWS pack lives at deploy/terraform/aws on main of the product repository, and in the license zip. It creates a VPC, private RDS for PostgreSQL, an ECR repository, and an App Runner service with HTTPS on port 3000. App Runner pulls from ECR only, so you mirror the public GitHub Container Registry image once. No GHCR login.

Before apply

  • AWS credentials that can create VPC, RDS, ECR, IAM, and App Runner
  • Terraform 1.5 or later, Docker, and the AWS CLI
  • The digest and cosign.pub. Verify the image before you mirror it.

Apply

1

Set variables

license_file_path is not mounted.
2

Create the ECR repository and mirror the digest

mirror-image.sh checks that the argument matches sha256: plus 64 hex digits, pulls ghcr.io/rahilp/backtale@<digest> with no GHCR login, and pushes that image to your ECR repository. Set AWS_REGION if the CLI has no default region.
3

Create the rest

Set app_base_url to the apprunner_service_url output (or your custom domain) and apply again.
4

Enable pgvector and finish setup

Connect to RDS (bastion, SSM port-forward, or a temporary jump host) and run:
Open https://<apprunner_service_url>/setup with terraform output -raw auth_setup_token. Store terraform output -raw token_encryption_key outside AWS. After First run, delete the AUTH_SETUP_TOKEN parameter and remove it from the App Runner service, then deploy a new revision.
Secrets Terraform writes: SSM SecureString parameters for DATABASE_URL, DIRECT_URL (sslmode=require), TOKEN_ENCRYPTION_KEY, and AUTH_SETUP_TOKEN.

Upgrade

Snapshot RDS. Verify the new digest, run ./mirror-image.sh sha256:<new> "$(terraform output -raw ecr_repository_url)", set image_digest, and terraform apply. Read Upgrade by digest first if a database is already in use.