Set up production infrastructure for the Admin service on admin.getorcha.com.
The admin infrastructure includes:
admin.prod.getorcha.com + admin.getorcha.comadmin.* to admin target group/v1-orcha/admin for admin service logsAfter Phase 1-3 deployment (foundation, data, compute, ops stacks exist).
This is a one-time setup for adding admin service to an existing environment.
orcha-prod)Create a certificate that covers both admin domains. This requires cross-account DNS validation.
Using the helper script (recommended):
cd /home/volrath/code/orcha/orcha/infra
./scripts/create-cross-account-cert.sh \
--name admin \
--primary-domain admin.prod.getorcha.com \
--san admin.getorcha.com
The script will request the certificate, add validation records to both zones, wait for validation, and output the ARN.
See acm-certificates.md for manual steps or troubleshooting.
Create a separate Google OAuth app for admin authentication. Configure it as Internal to restrict access to @getorcha.com Workspace users only.
Configure OAuth Consent Screen (if creating new app):
Orcha Adminopenid, email, profileCreate OAuth 2.0 Client ID:
Orcha Admin Authhttps://v1-orcha-admin-auth.auth.eu-central-1.amazoncognito.com/oauth2/idpresponseNote the Client ID and Client Secret - these go into:
/v1-orcha/admin-cognito-google-client-id/v1-orcha/admin-cognito-google-client-secretBefore deploying, update the admin certificate ARN in stacks/compute_stack.py:
# Replace <ADMIN_CERTIFICATE_ARN> with actual ARN from Phase 0.1
self.admin_certificate = acm.Certificate.from_certificate_arn(
self,
"AdminCertificate",
certificate_arn="arn:aws:acm:eu-central-1:700558745280:certificate/xxxx",
)
Deploy all stacks:
cd /home/volrath/code/orcha/orcha/infra
cdk deploy --all --context env_name=prod
Add to your secrets file:
/v1-orcha/admin-cognito-google-client-id=<FROM_CONSOLE>
/v1-orcha/admin-cognito-google-client-secret=<FROM_CONSOLE>
Then run:
./scripts/update-secrets.sh --from-file secrets --profile orcha-prod
# Dry run first
./scripts/setup-admin-cognito-idp.sh --profile orcha-prod --dry-run
# Apply changes
./scripts/setup-admin-cognito-idp.sh --profile orcha-prod
Add CNAME for vanity domain in management account (getorcha.com zone):
admin.getorcha.com CNAME admin.prod.getorcha.com TTL=300
Use the /delegate-subdomain skill or AWS CLI:
aws route53 change-resource-record-sets \
--profile orcha-management \
--hosted-zone-id <MANAGEMENT_ZONE_ID> \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "admin.getorcha.com",
"Type": "CNAME",
"TTL": 300,
"ResourceRecords": [{"Value": "admin.prod.getorcha.com"}]
}
}]
}'
aws acm describe-certificate \
--profile orcha-prod \
--region eu-central-1 \
--certificate-arn <ADMIN_CERT_ARN> \
--query 'Certificate.Status'
# Expected: "ISSUED"
aws elbv2 describe-target-health \
--profile orcha-prod \
--target-group-arn $(aws elbv2 describe-target-groups \
--profile orcha-prod \
--names v1-orcha-admin-tg \
--query 'TargetGroups[0].TargetGroupArn' --output text)
# Expected: State="healthy"
aws cognito-idp describe-user-pool \
--profile orcha-prod \
--user-pool-id $(aws ssm get-parameter \
--profile orcha-prod \
--name /v1-orcha/admin-cognito-user-pool-id \
--query 'Parameter.Value' --output text)
dig admin.getorcha.com
dig admin.prod.getorcha.com
# Both should resolve to ALB
https://admin.getorcha.comCause: DNS validation records not added or not propagated.
Fix:
Expected behavior! The Internal OAuth app restricts access to @getorcha.com Workspace users only.
Cause: Redirect URI in Google Console doesn't match Cognito callback.
Fix: Ensure the Google OAuth app has this exact redirect URI:
https://v1-orcha-admin-auth.auth.eu-central-1.amazoncognito.com/oauth2/idpresponse
Cause: Admin service not running on port 7777 or /health endpoint not responding.
Fix:
Cause: CDK deployment created placeholders but real credentials not stored.
Fix:
./scripts/update-secrets.sh --from-file secrets./scripts/setup-admin-cognito-idp.sh --profile orcha-prod| Resource | Prod Value |
|---|---|
| Admin User Pool Name | v1-orcha-admin-pool |
| Admin Cognito Domain | v1-orcha-admin-auth |
| Admin Google IdP Name | Google |
| Admin Redirect URI | https://v1-orcha-admin-auth.auth.eu-central-1.amazoncognito.com/oauth2/idpresponse |
| Admin Target Group | v1-orcha-admin-tg |
| Admin Port | 7777 |
| Admin Log Group | /v1-orcha/admin |
| Setup Script | scripts/setup-admin-cognito-idp.sh |
| Admin URL (prod) | https://admin.prod.getorcha.com |
| Admin URL (vanity) | https://admin.getorcha.com |