infra/dns/README.md
DNS Infrastructure
Pulumi project managing all studyflash.* Cloudflare zones, DNS records, and redirect rulesets.
DNS Infrastructure
Pulumi project managing all studyflash.* Cloudflare zones, DNS records, and redirect rulesets.
Managed domains
| Domain | Purpose |
|---|---|
studyflash.ai | Primary domain — landing page, app, API, email |
studyflash.ch | Internal services, landing page, redirects to .ai |
studyflash.dev | Dev environments + internal tools — wildcard A + Zero Trust access |
studyflash.at | Redirect → studyflash.ai/de |
studyflash.com | Redirect → studyflash.ai |
studyflash.de | Redirect → studyflash.ai/de |
studyflash.eu | Redirect → studyflash.ai |
studyflash.fr | Redirect → studyflash.ai/fr |
studyflash.it | Redirect → studyflash.ai/it |
studyflash.nl | Redirect → studyflash.ai/nl |
File structure
index.ts Engine — loops over zone configs, creates Pulumi resources
types.ts Shared types (DnsRecord, Redirect, ZoneConfig)
zones/
studyflash.ai.ts DNS records + geofence redirect ruleset
studyflash.ch.ts DNS records + redirect ruleset
studyflash.dev.ts Wildcard DNS + Zero Trust access app
redirects.ts Simple redirect domains (at, com, de, eu, fr, it, nl)
Adding a DNS record
Edit the zone file (e.g. zones/studyflash.ai.ts) and add an entry to the records array:
{ name: 'new-subdomain', type: 'CNAME', content: 'target.example.com', ttl: 3600 },
Run pnpm preview to verify, then merge to main — CI runs pulumi up automatically.
Adding a new redirect domain
Add a row to zones/redirects.ts:
{ tld: 'es', zoneId: '<cloudflare-zone-id>', locale: 'es' },
Usage
pnpm preview # diff against live state (via infisical)
pnpm run pulumi:up # apply changes
pnpm typecheck # type-check
pnpm format # apply prettier
Prerequisites
- Pulumi CLI
- Infisical CLI (authenticated)
- pnpm
State is stored in an R2 bucket accessed via PULUMI_BACKEND_URL from Infisical.