Cloud Playbooks¶
Practical paths for designing, building, and operating cloud systems. Each playbook connects the why, the manual workflow, the automation layer, and the production checks that prevent avoidable incidents.
Start in a sandbox. Use least-privilege identities, budgets, private networking by default, and destroy temporary resources after each exercise.
Choose Your Path¶
| Goal | Start with | Then automate with | Production check |
|---|---|---|---|
| Launch a web server | AWS guide | Terraform guide | Health check, logs, restricted ingress |
| Publish a static site | AWS S3 workflow in the hands-on labs | Terraform and CI/CD | Private origin, CDN, HTTPS, rollback |
| Run containers | Docker guide | Kubernetes guide | Image scan, resource limits, probes |
| Ship safely | Azure DevOps guide | DevOps projects | Approval gates, artifacts, rollback |
| Improve reliability | Monitoring guide | GitOps and alerts | SLOs, dashboards, tested recovery |
Playbook 1: Web Service From Zero to Repeatable¶
Design¶
Developer -> Git -> CI checks -> Terraform plan -> Cloud resources -> HTTP service
\-> logs, metrics, alerts
Manual checkpoint¶
- Select a region and define an owner, environment, and expiry date.
- Create a private network or use a controlled default network in a sandbox.
- Create a security group with only the required application port.
- Launch the smallest suitable compute instance.
- Install the service and verify its health endpoint.
- Record the public address, logs location, and cleanup command.
Automation checkpoint¶
Move each manual decision into versioned code:
- Provider and region become variables.
- Network and security rules become resources.
- User data or cloud-init installs the service consistently.
- Outputs expose only useful values such as an address or load balancer name.
- CI runs formatting, validation, plan, security scanning, and approval before apply.
Use the complete AWS EC2 manual-to-Terraform lab for a working example.
Playbook 2: Infrastructure as Code That Teams Can Trust¶
A reliable Terraform repository usually has this shape:
infra/
├── envs/
│ ├── dev/
│ └── prod/
├── modules/
│ ├── network/
│ └── service/
├── backend.tf
├── providers.tf
├── variables.tf
└── outputs.tf
Review gates¶
terraform fmt -checkterraform init -upgradein a controlled build imageterraform validateterraform plan -out=tfplan- Policy and secret scanning
- Human review of destructive changes
- Apply the saved plan, not a second unreviewed plan
Keep state in a protected remote backend with encryption and locking. Separate environments by state, identity, and approval boundary.
Playbook 3: Container to Kubernetes¶
Build¶
docker build --tag example-service:dev .
docker run --rm --publish 8080:8080 example-service:dev
Promote¶
- Add a health endpoint and graceful shutdown.
- Build an immutable image tagged with a commit SHA.
- Scan the image before pushing it to a registry.
- Define CPU and memory requests and limits.
- Add readiness and liveness probes.
- Deploy with a manifest or Helm chart.
- Observe the rollout, then verify the service from outside the cluster.
Read the Docker guide, Cloud Native guide, and GitOps guide for the detailed layers.
Playbook 4: CI/CD With a Safe Promotion Model¶
stages:
- stage: Verify
jobs:
- job: Quality
steps:
- script: ./scripts/test.sh
- script: ./scripts/security-scan.sh
- script: terraform plan -out=tfplan
- stage: DeployDev
dependsOn: Verify
jobs:
- script: terraform apply tfplan
- stage: ProductionApproval
dependsOn: DeployDev
jobs:
- deployment: DeployProduction
environment: production
strategy:
runOnce:
deploy:
steps:
- script: terraform apply tfplan
The important part is not the YAML syntax. It is the contract: the same artifact is tested once, promoted through controlled environments, and deployed with an auditable identity.
Playbook 5: Operate What You Deploy¶
Before calling a service production-ready, answer these questions:
- What is the service-level objective?
- Which dashboard shows traffic, errors, latency, and saturation?
- Which alert wakes a person, and which alert creates a ticket?
- Where are application and audit logs retained?
- How do you roll back the last release?
- What is the recovery point and recovery time objective?
- Who owns the service and the runbook?
Continue with Monitoring, DevSecOps, and DevOps Projects.
Suggested Progression¶
- Build the EC2 lab manually.
- Rebuild it with Terraform.
- Add CI validation and a saved plan.
- Containerize the service with Docker.
- Deploy it to Kubernetes.
- Add dashboards, alerts, and a rollback drill.
- Document the architecture and teach the workflow to another engineer.