This page covers the Terraform modules that provision the infrastructure Onyx runs on — network,
Kubernetes cluster, database, and the rest. They run before Onyx exists.To configure a deployment that is already running — LLM providers, connectors, document sets,
agents — use the Onyx Terraform provider instead.
Each cloud has its own release tags, independent of Onyx releases. To use the modules from your own repository,
set a
git:: source and pin a ref:
These modules are intended as a reference implementation.
They reflect how we deploy Onyx 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 composedonyx module wires together the building blocks below.
You can also use them individually if you need more granular control.
Prerequisites
1
2
Clone the Onyx repo
modules/aws/. You will create a small root module that calls them.Quickstart
The snippet below is a minimal root module that provisions a complete Onyx stack on AWS using the composedonyx
module.
main.tf
Common configuration
The composedonyx module exposes the inputs you’ll most often want to tune.
Core
Prefix for every resource created by the module. Combined with the active Terraform workspace,
so the same code base can manage multiple environments.
Master password for the RDS Postgres instance.
Marked sensitive — pass via
TF_VAR_postgres_password or your secrets manager rather than hard-coding.T-shirt size that sets coherent defaults for every compute and data-plane knob.
small fits pilots and small teams (up to about 200 users and 500k documents),
medium a typical department or company (about 200 to 1,000 users and 0.5 to 2M documents),
and large org-wide deployments (1,000+ users, multi-million documents).
Any sizing variable you set explicitly overrides its tier default.Base tags applied to every AWS resource created by the modules.
Networking
When
true, the module creates a new VPC sized for EKS.
Set to false to reuse an existing VPC — see Using an existing VPC.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.Enable the private EKS API endpoint. Recommended for production. You can enable both public and private together,
or only private.
CIDR blocks allowed to reach the public EKS API endpoint when it is enabled.
Database & cache
Enables RDS IAM authentication and wires an IRSA role into the EKS module so Onyx workloads can connect to Postgres
without a static password. Requires
rds_db_connect_arn to be set.Craft sandboxes
Create a dedicated node group for Craft sandbox pods.
The nodes carry the
onyx.app/workload=sandbox label and the workload=sandbox:NoSchedule taint that the Helm
chart’s sandbox pods select by default, and limit the instance metadata hop count to 1.
Tune the group with the craft_sandbox_node_* variables.OpenSearch (optional)
Managed OpenSearch is off by default. Enable it if you want a managed document index instead of the in-cluster OpenSearch node group. If you provision a managed document index, disable the in-cluster OpenSearch in your Helm values and set the connection variables. See configure Onyx with OpenSearch. Setvespa_node_enabled = false to skip the dedicated in-cluster index node group.
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 Onyx.
Optional IP allowlist. Leave empty to allow all source IPs subject to the managed rule sets and rate limits.
modules/aws/onyx/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 onyx module exposes the values you’ll need to configure the Helm chart.
Read them with
terraform output:
Install Onyx with Helm
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 onyx-workload-access in the onyx namespace,
which has access to the S3 bucket the module created. Point the chart at it and disable the in-cluster object store,
and the legacy MinIO store, 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 Onyx.Workspaces and multiple environments
Every resource theonyx module creates is named with the active Terraform workspace,
so the same root module can manage isolated environments without collisions:
name = "onyx" module call in workspace prod will produce onyx-prod-prefixed resources,
while the same call in dev produces onyx-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 OpenSearch node group is tainted. The
eksmodule provisions a dedicated document-index node group with avespa-dedicated=true:NoScheduletaint. The group keeps its legacyvespaname so existing clusters are not replaced. To run in-cluster OpenSearch on this group, add these overrides to your Helm values file and pass it with-f values.yamlwhen installing the chart:The chart does not set these overrides by default. Without the toleration, OpenSearch cannot run on this node group.
Configure Onyx as code
Onyx Terraform Provider
Declare LLM providers, connectors, document sets, agents, and user groups in Terraform and apply them from CI.
Next Steps
Configure Authentication
Set up authentication for your Onyx deployment with OAuth, OIDC, or SAML.
More Onyx Configuration Options
Learn about all available configuration options for your Onyx deployment.