# cloudstack.yaml
name: my-api
runtime: node-20
regions:
- us-east-1
- eu-west-1
- ap-south-1
resources:
cpu: 2
memory: 4GB
scaling:
min: 2
max: 50
target_cpu: 70
# Deploy with one command
$ cloudstack deploy
# Scale horizontally
$ cloudstack scale my-api --replicas 10
✓ Scaled to 10 replicas across 3 regions
# Add a new region
$ cloudstack regions add ap-northeast-1
✓ Added Tokyo region (ap-northeast-1)
# Resize resources
$ cloudstack resize my-api --cpu 4 --memory 8GB
✓ Resized with zero downtime
# Enable auto-scaling with custom metric
$ cloudstack autoscale set \
--metric requests_per_second \
--target 1000 --min 3 --max 100
✓ Auto-scaling policy configured
# View real-time metrics
$ cloudstack metrics my-api --live
┌─────────────────────────────────┐
│ Requests: 12,847/min │
│ Latency: 23ms (p50) │
│ 41ms (p95) │
│ 67ms (p99) │
│ CPU: 34.2% │
│ Memory: 2.1 GB / 4 GB │
│ Error: 0.02% │
└─────────────────────────────────┘
# Set up alerts
$ cloudstack alerts create \
--metric error_rate \
--threshold 1% --channel slack