Skip to content

Deploy with Terraform

The stack at deploy/terraform is a thin root (provider config) instantiating the provider-free stack/ module, which Pulumi users wrap directly. It serves the fargate and eks compute targets.

sh
cd deploy/terraform
cp terraform.tfvars.example terraform.tfvars   # then edit (pick your backends)
export TF_VAR_supabase_db_password="$(openssl rand -base64 24)"   # supabase db
export SUPABASE_ACCESS_TOKEN=sbp_…              # only when a supabase backend is used
terraform init
terraform apply
terraform output engine_url

Backend selectors

VariableOptionsNotes
compute_backendfargate · eksEKS provisions the cluster; install the engine chart afterward (kyma deploy up automates it).
database_backendsupabase · rds · externalexternal reads database_url (sensitive).
storage_backendsupabase · s3 · externals3 is keyless (task/pod role); external reads storage_endpoint + keys.
auth_backendsupabase · token · oidctoken reads admin_token; oidc reads oidc_issuer/oidc_client_id.

Modules are gated by these selectors (count), so only the resources your combination needs are created.

What it creates

ModuleWhenResources
networkalways2-AZ VPC (public + private subnets, no NAT), and — for fargate — an ALB + target group with /health checks + optional ACM/Route53. EKS sets create_alb = false (ingress instead).
ecs-servicecompute=fargateECS cluster, ARM64 Fargate task + service, task role (scoped S3), execution role (SSM injection), CloudWatch logs.
ekscompute=eksEKS cluster + managed node group + OIDC provider + an IRSA role for keyless S3.
supabasedatabase or storage = supabaseSupabase project (catalog Postgres + Auth) + anon key.
rdsdatabase=rdsPrivate, encrypted Postgres in the VPC, backups on, reachable only inside the VPC.
storagestorage=s3Versioned, encrypted, private S3 extent bucket with lifecycle expiry.
secretscompute=fargateSSM SecureString params: catalog URL, KYMA_SECRET_KEY, auth/storage secrets. (EKS/Helm inject secrets via a Kubernetes Secret instead.)

Key variables

VariableNotes
supabase_org_id, supabase_db_passwordRequired only when a Supabase backend is used (conditionally validated). Pass the password via TF_VAR_….
database_urlRequired for database_backend = external. Sensitive — TF_VAR_database_url.
rds_instance_classRDS sizing (default db.t4g.micro).
storage_endpoint, storage_bucket, storage_region, storage_access_key, storage_secret, storage_path_styleExternal S3-compatible store.
admin_tokenRequired for auth_backend = token (KYMA_AUTH_TOKENS=<token>:admin). Sensitive.
oidc_issuer, oidc_client_idFor auth_backend = oidc.
admin_emailsSign-ins with these emails get the kyma admin role (supabase/oidc).
allowed_email_domainsSet it for open Supabase signup — otherwise anyone who can register gets read access.
oauth_providersLogin-page buttons (e.g. ["google","github"]); enable the same in Supabase.
domain, route53_zone_idCustom domain + automated TLS (fargate). Without a zone id, apply prints the ACM validation CNAME and waits.
eks_kubernetes_version, eks_instance_types, eks_desired_sizeEKS sizing.
image_tagPin a release (vX.Y.Z).
task_cpu, task_memory, desired_countFargate sizing. Keep desired_count = 1 — the engine is single-writer per catalog.

Validate every combination

terraform validate checks the configuration for all backend values at once:

sh
terraform -chdir=deploy/terraform/stack init -backend=false
terraform -chdir=deploy/terraform/stack validate
terraform fmt -check -recursive deploy/terraform

State

Local state by default. For teams, uncomment the S3 backend block in backend.tf, create the bucket + lock table once, and terraform init -migrate-state.

Costs

Fargate: ALB ~$16/mo + one 0.5 vCPU/1 GB ARM64 task ~$15/mo + storage + DB tier. No NAT gateway. EKS adds the control-plane (~$73/mo) + node group — pick it when you want Kubernetes, not for the cost floor.

Limitations

  • gRPC (Arrow Flight) and OTLP-gRPC are disabled (HTTP-only ALB/ingress); OTLP/HTTP and REST ingest work. An NLB variant is future work.
  • The engine self-migrates the catalog on first connect; no bootstrap job.
  • EKS provisions the cluster only — the engine is installed via the Helm chart (the CLI does this in kyma deploy up).

An open-source project · MIT licensed.