Terraform
The Terraform path supports AWS, Azure, and GCP from one shared deployer. The AWS, scripted path stays the stable, AWS-only option. Both coexist and produce the same running platform.
Mental model: two layers, upgraded separately
| Layer | Owner | State |
|---|---|---|
| VPC/network, firewall, VMs, disks, SSH key | Terraform | terraform.tfstate |
| App (env render, Docker Compose, gateways, reverse proxy) | The deploy script, over SSH | Docker named volumes on the VMs |
Terraform provisions the infrastructure; the deploy script reads its output
plus your .env and installs the app. The compose/gateway/proxy runtime it
syncs is shared with the AWS scripted path.
Prerequisites
- Terraform >= 1.5.
- AWS: credentials via the default chain (
aws configureorAWS_PROFILE); set region/profile interraform.tfvars. - Azure:
az login(or a service principal); set subscription/location. - GCP:
gcloud auth application-default login; set project/region/zone.
Terraform generates the SSH keypair itself and writes the private key locally. On AWS it also creates the IAM role and instance profile every Cortega EC2 instance needs, including read access for the AWS-native provider integrations Cortega supports.
Next
Run terraform apply in the cloud-specific directory, then the deploy
script over SSH to install the app. See
Install overview for first login. Full day-2
operations are covered in the Terraform runbook that ships in the release
package.
Lite install
For AWS, 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. Set the option in the AWS runtime env file consumed by the existing
Terraform deploy step; it does not change Terraform resources or enter state.
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
Full and lite use the same release package. For AWS Terraform installs, select
lite by setting CORTEGA_INSTALL_LITE=yes in deploy/terraform/aws/.env (or the
custom runtime env file passed to the deployer). The default is no. Terraform
has no interactive lite question; this setting belongs to the runtime deploy
layer, not Terraform variables or state. Run the normal deploy after changing it.
For Terraform upgrades, deploy/migrate-package-env.py --mode terraform --cloud aws reconciles deploy/terraform/aws/.env against the target runtime
template. It preserves an existing lite setting and supplies the template's
no default when the setting is absent, without asking a separate lite
question. It does not modify Terraform state. Run the Terraform deploy step
after migration to apply the runtime configuration.