These modules are intended as a reference implementation.
They reflect how we deploy Zortex and encode sensible defaults,
but every environment is different — you should treat them as a starting point to fork and adapt to your account,
networking, and compliance requirements rather than a black box to consume as-is.
What gets provisioned
The composedzortex module wires together the building blocks below.
You can also use them individually if you need more granular control.
Prerequisites
1
2
Clone the Zortex repo
modules/aws/. You will create a small root module that calls them.3
Pick an AWS region and a name
The
name variable is used as a prefix for everything the modules create (VPC, cluster, RDS, S3 bucket, etc.)
and is combined with the current Terraform workspace, so the same code can produce isolated dev, staging,
and prod environments.Quickstart
The snippet below is a minimal root module that provisions a complete Zortex stack on AWS using the composedzortex
module.
main.tf
Common configuration
The composedzortex module exposes the inputs you’ll most often want to tune.
Core
string
default:"zortex"
Prefix for every resource created by the module. Combined with the active Terraform workspace,
so the same code base can manage multiple environments.
string
default:"us-west-2"
AWS region for all resources.
string
required
Master username for the RDS Postgres instance.
string
required
Master password for the RDS Postgres instance.
Marked sensitive — pass via
TF_VAR_postgres_password or your secrets manager rather than hard-coding.map(string)
default:"{\"project\":\"zortex\"}"
Base tags applied to every AWS resource created by the modules.
Networking
bool
default:"true"
When
true, the module creates a new VPC sized for EKS.
Set to false to reuse an existing VPC — see Using an existing VPC.bool
default:"true"
Whether the EKS API endpoint is reachable from the public internet.
Combine with
cluster_endpoint_public_access_cidrs to lock it down to specific IPs.bool
default:"false"
Enable the private EKS API endpoint. Recommended for production. You can enable both public and private together,
or only private.
list(string)
default:"[]"
CIDR blocks allowed to reach the public EKS API endpoint when it is enabled.
Database & cache
bool
default:"false"
Enables RDS IAM authentication and wires an IRSA role into the EKS module so Zortex workloads can connect to Postgres
without a static password. Requires
rds_db_connect_arn to be set.number
default:"7"
Days to retain automated RDS backups. Set to
0 to disable.string
Optional auth token for Redis. Marked sensitive.
OpenSearch (optional)
Managed OpenSearch is off by default. Enable it if you want a managed document index backend instead of the in-cluster Vespa node group. If provisioning a managed document index, you should disable starting an OpenSearch container in your relevant docker-compose/Helm as Zortex will not use this container. You should also set the relevant environment variables. See how to configure Zortex with OpenSearch.bool
default:"false"
Provision an Amazon OpenSearch domain inside the VPC.
string
default:"r8g.large.search"
number
default:"3"
string
string
WAF
Thewaf module is optional but strongly recommended for any internet-facing deployment.
It provisions an AWS WAFv2 web ACL with the common managed rule sets, rate limits,
and optional geo blocking that you can attach to the load balancer fronting Zortex.
Tune the inputs below to fit your traffic profile.
list(string)
default:"[]"
Optional IP allowlist. Leave empty to allow all source IPs subject to the managed rule sets and rate limits.
number
default:"2000"
number
default:"1000"
list(string)
default:"[]"
Country codes to block. Leave empty to disable geo restrictions.
modules/aws/zortex/variables.tf.
Using an existing VPC
If you already have a VPC you want to deploy into, setcreate_vpc = false and pass in the VPC details,
including the ID of an existing S3 gateway VPC endpoint that the bucket policy will reference.
Production hardening
For production environments we recommend the following deltas from the quickstart:Outputs
Onceterraform apply finishes, the zortex module exposes the values you’ll need to configure the Helm chart.
Read them with
terraform output:
Install Zortex with Helm
Terraform only stands up the infrastructure — Zortex itself is installed via the Helm chart.1
Update kubeconfig
2
Create the namespace
3
Install the chart
The EKS module creates an IRSA-backed You’ll also want to wire the chart’s database, Redis, and (optionally)
OpenSearch settings to the Terraform outputs via your own
ServiceAccount named zortex-workload-access in the zortex namespace,
which has access to the S3 bucket the module created.
Point the chart at it and disable the in-cluster MinIO so file storage uses the real S3 bucket.values.yaml.
See the Kubernetes deployment guide for the full set of values.4
Verify
Running before accessing Zortex.Workspaces and multiple environments
Every resource thezortex module creates is named with the active Terraform workspace,
so the same root module can manage isolated environments without collisions:
name = "zortex" module call in workspace prod will produce zortex-prod-prefixed resources,
while the same call in dev produces zortex-dev resources.
Notes & gotchas
- Sensitive outputs.
postgres_username,redis_connection_url, and the EKS CA data are marked sensitive. Hand them off to your secrets manager or Helm values file rather than echoing them to logs. - State storage. The quickstart uses local state for brevity. For shared or production use, configure an S3 backend with DynamoDB locking.
- First apply is infra-only. EKS takes several minutes to become active.
The
null_resource.wait_for_clusterblock in the quickstart blocks the Kubernetes/Helm providers until the API server is reachable. - The Vespa node group is tainted. The
eksmodule provisions a dedicated node group for Vespa with avespa-dedicated=true:NoScheduletaint. The Helm chart’s Vespa pods tolerate it; everything else lands on the main node group. - Reference, not a product. The modules encode the choices we make for our own deployments. Read them, copy what’s useful, and replace what isn’t.
Next Steps
Configure Authentication
Set up authentication for your Zortex deployment with OAuth, OIDC, or SAML.
More Zortex Configuration Options
Learn about all available configuration options for your Zortex deployment.
