Operations
Runbooks
-
Zappa to SAM cutover: moving from the Zappa deployments to the SAM stacks
-
Rollback: going back to Zappa
-
Decommissioning Zappa: removing Zappa after the soak period
Health checks
| Check | How |
|---|---|
Stream consumer keeps up |
|
Rules run |
New items in |
Watchdog runs |
|
CRM events arrive |
|
API healthy |
|
Errors |
Sentry, |
Useful commands
# Stack outputs: API id and URL, function ARNs
aws cloudformation describe-stacks --stack-name eventlogger-rules-prod --query 'Stacks[0].Outputs' --profile prod
# Follow a function's logs
sam logs --stack-name eventlogger-rules-prod --name WorkerFunction --tail --profile prod
# Kinesis mapping state and start position
aws lambda list-event-source-mappings --function-name <WorkerFunctionArn> \
--query 'EventSourceMappings[].[UUID,State,StartingPosition]' --profile prod
# Consumer lag over the last 15 minutes (macOS date syntax)
aws cloudwatch get-metric-statistics --namespace AWS/Lambda --metric-name IteratorAge \
--dimensions Name=FunctionName,Value=<WorkerFunctionName> --statistics Maximum --period 60 \
--start-time "$(date -u -v-15M +%FT%TZ)" --end-time "$(date -u +%FT%TZ)" --profile prod
Use dev and eventlogger-rules-dev for staging.