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.

Lite install​

Set CORTEGA_INSTALL_LITE=yes in the runtime .env to omit Insights reports, platform metrics and Presidio PII detectors. Gateway, console, configuration, traffic telemetry and cost reporting remain available in single-node and multi-node installs. Insights and Presidio options are hidden in the console; Platform Health checks only installed components. The AWS setup script asks for this option and saves it.

Run the normal deploy after changing the option. Excluded containers are removed and their volumes retained; Postgres, Redis and ClickHouse data are retained. Review existing Presidio bindings before switching: their saved failure policy still applies when the detector is absent. To return to full, set the option to no and deploy again, allowing time for Superset dashboard reconciliation.

Instance types remain the administrator's choice and defaults are unchanged. The ClickHouse memory cap still applies automatically below 6 GiB. A change to CORTEGA_TRAFFIC_RETENTION_DAYS requires recreating the management backend; the remote deploy does this. Retention shorter than a month can under-count monthly budget month-to-date spend.

Choosing lite and upgrading​

Full and lite use the same release package. Lite is selected at installation or changed later; it is not a package-build option. The default is full (CORTEGA_INSTALL_LITE=no).

On the first interactive run, setup.sh asks Use the lite install? and saves yes or no in deploy/aws/.env. Subsequent interactive setup runs ask again, using the saved value as the default; pressing Enter keeps it. Non-interactive runs use the configured value, or no when absent. The deploy writes the setting into the remote runtime .env and applies it when recreating containers.

During package upgrades, deploy/migrate-package-env.py preserves an existing CORTEGA_INSTALL_LITE value. If the source install has no setting, the target package's env.example supplies no, keeping the install full. The Python migrator does not ask a separate lite question. To change modes during an upgrade, edit the migrated deploy/aws/.env or choose the mode in setup.sh, then run the normal deploy. Migration alone does not change running containers.