DevSecOps CI/CD and monitoring for a Lambda-backed booking system. Eight GitHub Actions stages, an OIDC-only path into AWS, a canary rollout that reverses itself on alarm — and the telemetry that decides whether it should.
principle every path to prod passes a scan, a test suite, a human review, and a post-deploy alarm
ci/cd pipeline · github actions
developers
GitHub
push a1f9c02
01
code
- Commit / PR
- Code review
queued
02
build & test
- Checkout
- Install deps
- Unit tests
- Lint
queued
03
security scan
- SAST (CodeQL)
- Dependency scan
- Secret scan
- IaC scan (Checkov)
queued
04
terraform plan
- terraform fmt
- terraform validate
- terraform plan
- Upload plan
queued
05
deploy to dev
- Terraform apply
- Deploy Lambda
- API Gateway
- DynamoDB
queued
06
integration tests
- Integration tests
- API tests
- Smoke tests
queued
07
prod approval
- Manual approval
- GitHub environment
queued
08
deploy to prod
- Terraform apply
- AWS CodeDeploy
- Canary deployment
queued
artifacts · from 02
GitHub Actions → Amazon S3
secure access · from 04
OIDC → AWS IAM role
aws runtime · serverless
What stage 08 actually ships. The request path below replays on a loop — one booking, from the phone in someone’s hand to the confirmation SMS.
clients
Mobile & Web App
auth
Amazon Cognito
edge
Amazon API Gateway
AWS WAF (optional)
aws lambda functions
Availability
Booking
Appointment mgmt
Notification
state
Amazon DynamoDB
schedule
Amazon EventBridge
notify
Amazon SNS / SES
prod canary deployment
aws codedeploy · lambda aliases
standby
new version 0%
current version 100%
5%
25%
50%
100%
5XX · p95 · booking success rate within budget
cloudwatch alarmsabort & roll back
observability & monitoring
The canary above only has an opinion because these do. Everything here is provisioned by the same Terraform the pipeline applies — a service ships with its alarms or it does not ship.
metrics
CloudWatch
- API Gateway 4XX / 5XX / latency
- Lambda invocations, errors, duration, throttles
- DynamoDB latency, throttles, capacity
- Custom business metrics: bookings, conflicts
logs
CloudWatch Logs
- Structured JSON logs
- Correlation ID per request
- Retention policy per log group
- Logs Insights saved queries
traces
X-Ray / App Signals
- End-to-end tracing
- Service map
- Latency analysis
- Error analysis
synthetics
CloudWatch Synthetics
- API health check — 5 min
- Full booking flow — 15 min
- Alert on failure
dashboards
CloudWatch
- Service health
- Business KPIs
- Deployment / canary
alarms
CloudWatch Alarms
- 5XX error rate
- Lambda errors / throttles
- p95 latency
- Booking success rate
- DLQ messages
- Canary alarms
alerting
Amazon SNS
- Slack
- PagerDuty
security foundations
AWS IAM
least privilege, per-function roles
AWS KMS
customer-managed keys
AWS Secrets Manager
rotated secrets, no env-var creds
VPC endpoints
private access, no NAT egress
S3 + DynamoDB
encryption at rest
AWS CloudTrail
audit log of every API call
AWS Config
drift and compliance rules