Deploying Infrastructure
Prerequisites
- AWS Account with admin access
- AWS CLI v2 configured (
aws configure) - Node.js 18+
- Domain name for PWA (optional, default: hq.indigoai.com)
SST Overview
HQ uses SST (Serverless Stack) v2 for infrastructure-as-code. SST wraps AWS CDK with a better DX for serverless apps.
The config lives at infra/sst.config.ts and defines:
- Cognito User Pool + Client
- S3 Bucket with CORS
- API Gateway v2 with JWT authorizer
- Lambda functions for file and auth operations
- CloudFront Static Site for PWA
Deploy
First-time setup
cd infranpx sst deploy --stage prodSST will:
- Bootstrap a CDK toolkit stack in your AWS account
- Create all resources defined in
sst.config.ts - Output the API URL, User Pool ID, Client ID, and site URL
Staging environments
npx sst deploy --stage devnpx sst deploy --stage stagingEach stage gets isolated resources (separate Cognito pool, S3 bucket, API).
Live development
npx sst devStarts SST in dev mode with live Lambda reloading. Changes to Lambda functions hot-reload without redeploying.
Post-Deploy Configuration
After first deploy, you’ll need the outputs:
- API URL — Set as
VITE_API_URLinapps/web/.env - User Pool ID — Set as
VITE_USER_POOL_ID - Client ID — Set as
VITE_USER_POOL_CLIENT_ID - Site URL — Configure DNS if using custom domain
Custom Domain
To use hq.indigoai.com:
- Add domain to Route 53 (or configure external DNS)
- Update
sst.config.tsStaticSite withcustomDomainproperty - Redeploy — SST handles ACM certificate provisioning
Monitoring
- CloudWatch Logs — Lambda function logs
- S3 Metrics — Storage usage per user
- API Gateway — Request counts, latency, error rates
- Cognito — User sign-ups, sign-ins
Tear Down
npx sst remove --stage prodCost Estimates
| Service | Pricing |
|---|---|
| Cognito | Free for first 50,000 MAU |
| S3 | ~$0.023/GB/month |
| Lambda | Free for first 1M requests/month |
| API Gateway | $1/million requests |
| CloudFront | $0.085/GB transfer |
For a small team (<100 users), expect <$10/month.