Skip to Content
LYNKORIADocs

Step 3: Configure

Review the per-environment OpenTofu settings — hostnames, product origins, LiveKit key references and sizes — and change them through a pull request.

Goal: infra/opentofu/platform/environments/staging.tfvars and production.tfvars describe what you want, and the change is merged.

These files hold reviewable, non-secret settings. Account-specific values (Cloudflare IDs, emails, registry, SSH keys, admin IPs) and secrets go into GitHub in step 4, so the repository never contains them.

3.1 What each setting means

SettingMeaning
environmentstaging or production
vpc_ip_rangePrivate range for this environment's VPC. Must not overlap another VPC in the account (doctl vpcs list)
api_host … turn_hostPublic hostnames, see the domain plan
scanner_hostName in the scanner certificate; a DNS-only record to the scanner's private IP
allowed_originsExact https:// origins of product web apps (browser CORS and bucket CORS). The console is added automatically
webhook_allowed_originsOrigins product webhooks may be delivered to
livekit_key_refsOne LiveKit key pair is generated per entry. A project environment's LiveKit key reference in the console must match one (for example vibelynk:production)
media_droplet_sizeMedia Droplet size, default c-4 (4 dedicated vCPUs, a pilot size)

Optional settings with defaults are in infra/opentofu/platform/variables.tf: scanner_droplet_size, postgres_size, postgres_version, postgres_pool_size, valkey_size, api_instance_count, api_instance_size, region (sgp1), app_region (sgp). Add any of them to the .tfvars file to override.

3.2 Edit and merge

git switch -c configure-environments
"${EDITOR:-nano}" infra/opentofu/platform/environments/staging.tfvars
"${EDITOR:-nano}" infra/opentofu/platform/environments/production.tfvars
pnpm infra:tofu
git commit -am "infra: configure environments"
git push -u origin configure-environments

Open a pull request. Once GitHub is configured (step 4), the Infrastructure workflow posts a tofu plan for staging on pull requests that touch infra/opentofu/.

3.3 Using a different domain

Change every hostname in both .tfvars files, apex and api_hosts in infra/opentofu/zone/variables.tf, and the console's Content Security Policy in apps/admin/public/_headers: its connect-src lists https://api.lynkoria.com and https://api-staging.lynkoria.com, and the browser blocks every other API host.

3.4 Adding a product later

Add its LiveKit reference to livekit_key_refs and its web origin to allowed_origins, merge, and deploy. The media Droplet is replaced when its LiveKit configuration changes (new keys), which ends active calls; deploy that change in a quiet window.

Next: Step 4: GitHub.

On this page