This runbook explains how to set up DNS delegation when creating a new environment (prod, dev, staging).
Orcha uses a subdomain delegation pattern for DNS:
Management Account (333886071599)
└── getorcha.com (root hosted zone)
├── Existing records (MX, TXT, www, etc.)
├── NS prod.getorcha.com → prod account nameservers
├── NS dev.getorcha.com → dev account nameservers
└── CNAME app.getorcha.com → app.prod.getorcha.com
Workload Accounts
├── orcha-prod (700558745280)
│ └── prod.getorcha.com (hosted zone)
│ └── app.prod.getorcha.com → ALB
│
└── orcha-dev (future)
└── dev.getorcha.com (hosted zone)
└── app.dev.getorcha.com → ALB
Each workload account manages its own subdomain. The management account's root hosted zone contains NS delegation records that point to the correct nameservers.
After deploying Phase 1 (FoundationStack + DataStack) to a new environment. The FoundationStack creates the subdomain hosted zone, but you must manually add the NS delegation in the management account.
orcha - Management accountorcha-prod - Production accountorcha-dev - Development account (when available)From CDK output:
# Check CloudFormation outputs
AWS_PROFILE=orcha-prod aws cloudformation describe-stacks \
--stack-name V1OrchaProdFoundation \
--query "Stacks[0].Outputs[?OutputKey=='HostedZoneId'].OutputValue" \
--output text
Or from Route53:
AWS_PROFILE=orcha-prod aws route53 list-hosted-zones \
--query "HostedZones[?Name=='prod.getorcha.com.'].Id" \
--output text
cd /home/volrath/code/orcha/orcha/infra
./scripts/delegate-subdomain.sh prod <HOSTED_ZONE_ID>
The script will:
# Should return workload account nameservers (ns-xxx.awsdns-xx.xxx)
dig NS prod.getorcha.com +short
# Test that queries are routed correctly
dig app.prod.getorcha.com +trace
For production, add a convenience CNAME so users can access the app without the prod subdomain:
AWS_PROFILE=orcha aws route53 change-resource-record-sets \
--hosted-zone-id Z02414383CQNYTPGX2EIK \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "app.getorcha.com",
"Type": "CNAME",
"TTL": 300,
"ResourceRecords": [{"Value": "app.prod.getorcha.com"}]
}
}]
}'
Cause: Wrong hosted zone ID or missing permissions.
Fix:
AWS_PROFILE=orcha-prod aws route53 get-hosted-zone --id <HOSTED_ZONE_ID>
Cause: DNS propagation not complete.
Fix: Wait 5-10 minutes and try again. Full propagation can take up to 48 hours in rare cases.
Cause: NS delegation not in place before deploying ComputeStack.
Fix:
dig NS prod.getorcha.com +short shows correct NS)Cause: Hosted zone was recreated (different zone = different NS).
Fix: Run the script again. It will detect the existing record and prompt to update.
| Item | Value |
|---|---|
| Root hosted zone ID | Z02414383CQNYTPGX2EIK |
| Root domain | getorcha.com |
| Management account | 333886071599 |
| Management profile | orcha |
| Script | scripts/delegate-subdomain.sh |
| Claude skill | /delegate-subdomain |