Skip to main content

AWS, scripted

One path drives every AWS topology. setup.sh asks whether you want a single-node install (the app and gateways on one EC2 instance) or a multi-node install (core services on one EC2, dedicated gateway EC2 nodes), how many gateways to run, and whether to put a load balancer in front.

Prerequisites

  • AWS CLI v2, configured with credentials for the target account (aws sts get-caller-identity should work).
  • ssh and rsync locally.
  • If the container images are private: a GitHub personal access token with read:packages access.

1. Configure

cp deploy/aws/env.example deploy/aws/.env

Edit deploy/aws/.env: instance type, image tag, and the platform secrets (POSTGRES_PASSWORD, CORTEGA_ENCRYPTION_KEY, JWT_SECRET, and others). You can leave secrets blank for a terminal run and deploy.sh will prompt you to accept generated defaults. Leave the app origin blank for a first pass; deploy.sh fills in a sensible default from the instance's public IP. Set it once you have real DNS pointed at the box.

2. Provision

deploy/aws/setup.sh

Creates (or reuses) an EC2 key pair, security group, IAM role, and instance with Docker preinstalled. Prints the public IP and SSH command when done.

Multi-node: answer multi when asked for the topology (or set INSTALL_TOPOLOGY=multi). The same script then provisions one core instance plus a configurable number of gateway instances, and an optional load balancer instance in front of both.

setup.sh is idempotent and namespaced by AWS_STACK_NAME. Running it again reconciles security-group rules, and two stacks with different names are fully isolated, so you can run staging and production (or two customers) in the same account.

3. Deploy

deploy/aws/deploy.sh

Re-runnable, and how you upgrade. Syncs deploy assets, pulls images at the configured tag, brings up the stack, reconciles gateways, and smoke-tests the app. Data volumes are preserved across every re-run.

Next

See Install overview for first login. Day-2 operations (upgrades, scaling the gateway fleet, teardown) are covered in the full aws-runbook.md that ships in the release package.