Nine spreads on how the cloud works and how to use it: compute, storage, networking, identity, databases, serverless, cost and security. Examples use AWS with notes for Azure and GCP.
"Infrastructure as code in private subnets across zones, least-privilege IAM roles, managed databases, autoscaling compute, and budgets with alerts."
Use the tabs or the ← → keys. Cloud services cost money. Set a budget alert first.
| Idea | AWS | Azure | GCP |
|---|---|---|---|
| VM | EC2 | Virtual Machines | Compute Engine |
| Object storage | S3 | Blob Storage | Cloud Storage |
| Managed SQL | RDS / Aurora | Azure SQL / PG | Cloud SQL |
| Functions | Lambda | Functions | Cloud Functions |
| Kubernetes | EKS | AKS | GKE |
| Identity | IAM | Entra ID + RBAC | IAM |
$ aws --version ; aws configure sso # prefer SSO / short-lived credentials $ aws sts get-caller-identity # who am I, which account? $ aws ec2 describe-regions --query 'Regions[].RegionName'
"Two or three AZs in one region, and we own IAM, data and configuration under the shared responsibility model."
# launch a small VM (AWS CLI) $ aws ec2 run-instances --image-id ami-0abcdef1234567890 --instance-type t3.micro \ --key-name mykey --security-group-ids sg-0123 --subnet-id subnet-0abc \ --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=web-1}]' $ aws ec2 describe-instances --filters Name=tag:Name,Values=web-1 \ --query 'Reservations[].Instances[].[InstanceId,State.Name,PublicIpAddress]' $ aws ec2 terminate-instances --instance-ids i-0123456789abcdef0 # stop paying
# a serverless function (Python, AWS Lambda)
import json
def handler(event, context):
name = (event.get("queryStringParameters") or {}).get("name", "world")
return {"statusCode": 200, "body": json.dumps({"hello": name})}
"Containers on a managed service for the web tier, Lambda for events, spot capacity for batch jobs."
$ aws s3 mb s3://my-unique-bucket-name $ aws s3 cp photo.jpg s3://my-unique-bucket-name/uploads/ $ aws s3 sync ./site s3://my-unique-bucket-name --delete $ aws s3 ls s3://my-unique-bucket-name --recursive --human-readable $ aws s3api put-bucket-versioning --bucket my-unique-bucket-name \ --versioning-configuration Status=Enabled $ aws s3api put-public-access-block --bucket my-unique-bucket-name \ --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true $ aws s3 presign s3://my-unique-bucket-name/uploads/photo.jpg --expires-in 600 # temporary link
"Private buckets with versioning and lifecycle rules, pre-signed URLs for access, and a CDN in front for public assets."
$ aws ec2 create-security-group --group-name web-sg --description "web" --vpc-id vpc-0abc $ aws ec2 authorize-security-group-ingress --group-id sg-0123 --protocol tcp --port 443 --cidr 0.0.0.0/0 $ aws ec2 authorize-security-group-ingress --group-id sg-app --protocol tcp --port 3000 --source-group sg-alb # app only accepts traffic from the load balancer's group, not the world $ aws ec2 describe-vpcs ; aws ec2 describe-route-tables
"Public subnets hold the load balancer, apps and databases sit in private subnets, and security groups reference each other."
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::my-unique-bucket-name/uploads/*"
}]
}
$ aws iam create-policy --policy-name app-uploads --policy-document file://policy.json $ aws iam create-role --role-name app-role --assume-role-policy-document file://trust.json $ aws iam attach-role-policy --role-name app-role --policy-arn arn:aws:iam::123456789012:policy/app-uploads $ aws iam get-account-authorization-details > iam.json # audit who can do what $ aws iam generate-credential-report
"Workloads assume scoped roles, humans use SSO with MFA, and Access Analyzer reviews what's exposed."
$ aws rds create-db-instance --db-instance-identifier shop-db --engine postgres \ --db-instance-class db.t4g.micro --allocated-storage 20 \ --master-username app --manage-master-user-password \ --multi-az --storage-encrypted --backup-retention-period 7 \ --no-publicly-accessible --db-subnet-group-name private-subnets \ --vpc-security-group-ids sg-db $ aws rds describe-db-instances --query 'DBInstances[].[DBInstanceIdentifier,DBInstanceStatus,Endpoint.Address]' $ aws rds create-db-snapshot --db-instance-identifier shop-db --db-snapshot-identifier before-upgrade
// DynamoDB: key-value at any scale (Node SDK v3)
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, PutCommand, GetCommand } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));
await db.send(new PutCommand({ TableName: "Orders", Item: { pk: "USER#42", sk: "ORDER#1001", total: 2400 } }));
const { Item } = await db.send(new GetCommand({ TableName: "Orders", Key: { pk: "USER#42", sk: "ORDER#1001" } }));
"Managed Postgres in private subnets with Multi-AZ, encryption and backups, secrets from Secrets Manager."
# main.tf (Terraform): a private, versioned, encrypted bucket
terraform {
required_providers { aws = { source = "hashicorp/aws", version = "~> 5.0" } }
backend "s3" { bucket = "my-tf-state" key = "app/terraform.tfstate" region = "eu-west-2" dynamodb_table = "tf-locks" }
}
provider "aws" { region = "eu-west-2" }
resource "aws_s3_bucket" "uploads" { bucket = "my-unique-bucket-name" }
resource "aws_s3_bucket_versioning" "uploads" {
bucket = aws_s3_bucket.uploads.id
versioning_configuration { status = "Enabled" }
}
resource "aws_s3_bucket_public_access_block" "uploads" {
bucket = aws_s3_bucket.uploads.id
block_public_acls = true block_public_policy = true
ignore_public_acls = true restrict_public_buckets = true
}
$ terraform init $ terraform fmt && terraform validate $ terraform plan -out tf.plan # read this carefully $ terraform apply tf.plan $ terraform destroy # tear down a lab to stop charges
"All infrastructure in Terraform with remote locked state, plan in the pull request, apply from CI."
$ aws budgets create-budget --account-id 123456789012 --budget file://budget.json \ --notifications-with-subscribers file://notify.json # email at 80% and 100% $ aws ce get-cost-and-usage --time-period Start=2026-10-01,End=2026-10-30 \ --granularity MONTHLY --metrics UnblendedCost --group-by Type=DIMENSION,Key=SERVICE $ aws ec2 describe-volumes --filters Name=status,Values=available # orphaned disks costing money $ aws ec2 describe-addresses --query 'Addresses[?AssociationId==null]' # unused elastic IPs
owner, project, env: enforce them in IaC"Budgets with alerts, mandatory tags, right-sized instances, and non-prod shut down out of hours."
$ aws cloudtrail describe-trails ; aws guardduty list-detectors $ aws configservice describe-compliance-by-config-rule $ aws iam get-account-summary | grep -i mfa $ npx checkov -d . # scan Terraform for misconfigurations $ prowler aws # security audit of your own account
destroy after"Multi-account landing zone, everything logged and monitored, IaC-enforced guardrails, and tested recovery."