Cloud Computing, AWS & Azure CLI Cheat Sheet
Your desk-side reference for cloud fundamentals, cross-provider service mapping, everyday AWS & Azure CLI commands, SLA math, and billing traps to avoid.
Anatomy of a Cloud CLI Command
Cloud CLIs read like a predictable sentence: Tool + Service + Action + Target + Flags. Once you see this pattern, you can guess almost any command.
az for Azure)
1 AWS vs Azure vs GCP Core Services
The big three clouds offer the same core building blocks under different brand names. Use this translator whenever you switch platforms.
| Category | What It Does | AWS | Microsoft Azure | Google Cloud (GCP) |
|---|---|---|---|---|
| Compute (VMs) | Rent virtual servers with CPU & RAM | EC2 (Elastic Compute Cloud) | Azure Virtual Machines | Compute Engine |
| Object Storage | Store unlimited files, backups, images | Amazon S3 | Azure Blob Storage | Cloud Storage |
| Block Storage | Virtual hard drives attached to VMs | EBS (Elastic Block Store) | Azure Managed Disks | Persistent Disk |
| Relational DB | Managed SQL (PostgreSQL, MySQL) | Amazon RDS / Aurora | Azure SQL / Flexible Server | Cloud SQL / Spanner |
| Networking / VPC | Private isolated cloud network & subnets | Amazon VPC | Azure Virtual Network (VNet) | VPC Network |
| IAM / Identity | Users, roles, permissions & SSO | AWS IAM | Microsoft Entra ID + RBAC | Cloud IAM |
| Serverless | Run code on events without managing servers | AWS Lambda | Azure Functions | Cloud Run Functions |
| Kubernetes | Managed container orchestration | Amazon EKS | Azure Kubernetes Service (AKS) | Google Kubernetes Engine (GKE) |
2 Essential AWS CLI Commands
The AWS CLI v2 uses aws <service> <operation>. Add --output table
or --dryrun whenever you want human-readable output or a safe test run.
aws configure
us-east-1), and output format (json).aws sts get-caller-identity
aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId,State.Name,PublicIpAddress]" --output table
aws s3 ls s3://my-bucket
aws s3 ls alone to list all buckets, or pass a
bucket path to inspect its objects.aws s3 cp ./backup.zip s3://my-bucket/
cp: swap source and destination to
download from S3 back to your laptop.aws s3 sync ./dist s3://my-bucket --delete
--delete removes
extra files in S3โtest with --dryrun first!aws iam list-users --output table
Add --output table when reading on screen, --output json when piping to jq, and --profile prod when switching between dev and prod accounts.
3 Essential Azure CLI Commands
The Azure CLI uses az <service> <action>. Almost every Azure resource must
live inside a Resource Group (-g or --resource-group).
az login
az login --use-device-code.az account show --output table
az account set --subscription "Name" to switch.az group create --name my-rg --location eastus
my-rg) in a region.
Deleting the group deletes everything inside it cleanly.az vm list -d --output table
-d (show details) includes public/private IPs and
whether each VM is running or deallocated.az storage blob list --account-name mystorage --container-name mycontainer --output table
--auth-mode login to use your Entra ID permissions.az aks get-credentials --resource-group my-rg --name my-aks
~/.kube/config so
you can immediately run kubectl get nodes.Think of an Azure Resource Group as a project folder. Put all lab VMs, disks,
and IPs in one groupโwhen you finish practicing, run az group delete -n my-rg to
wipe everything and guarantee zero leftover charges.
4 Cloud Pricing, SLA & Scaling Quick Reference
Interviews and architecture reviews love SLA "nines" math and cost-optimization models. Keep these numbers handy.
SLA Availability ("The Nines")
| SLA Target | Allowed Downtime / Year | Allowed Downtime / Month | Typical Use Case |
|---|---|---|---|
| 99% (Two Nines) | 3 days, 15 hours | 7.3 hours | Internal dev/test tools |
| 99.9% (Three Nines) | 8 hours, 45 minutes | 43.8 minutes | Single-region web apps |
| 99.95% | 4 hours, 22 minutes | 21.9 minutes | Standard Azure VM / Managed DB |
| 99.99% (Four Nines) | 52 minutes, 36 seconds | 4.38 minutes | Multi-AZ production services |
| 99.999% (Five Nines) | 5 minutes, 15 seconds | 26.3 seconds | Global banking, DNS (Route 53 = 100%) |
Pricing Models & Scaling Concepts
๐ณ On-Demand
Pay per second/hour with zero commitment. Highest unit price, maximum flexibility. Best for spiky or unpredictable workloads.
๐ Reserved / Savings Plans
Commit for 1 or 3 years to save up to 40โ72%. Best for steady-state databases and 24/7 production servers.
โก Spot / Preemptible
Rent spare cloud capacity at up to 70โ90% off, but the provider can reclaim it with 30sโ2m notice. Great for batch jobs & CI.
๐ CapEx vs OpEx
CapEx = buying physical servers upfront. OpEx = paying monthly cloud bills as you consume resources.
โฌ๏ธ Vertical (Scale Up)
Give one server more CPU/RAM (e.g. t3.micro โ t3.xlarge). Simple,
but hits a hardware ceiling & requires reboot.
โก๏ธ Horizontal (Scale Out)
Add more identical servers behind a Load Balancer. Virtually unlimited scale & high availability.
5 Danger Zone: Costly Cloud Mistakes
Never commit AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, or
.env files to GitHub. Automated bots scan public repos in seconds and can
spin up thousands of dollars in GPU instances. Use IAM Roles, Managed Identities, or
local profiles (~/.aws/credentials).
Keep Block Public Access enabled at the account and bucket level. Never
pass --acl public-read unless you are intentionally serving public static
assetsโand even then, prefer CloudFront/CDN with private origin access.
stop-instances vs terminate-instances
Running aws ec2 stop-instances (or stopping an Azure VM from inside the OS
without az vm deallocate) stops compute billing, but you still pay
for attached EBS disks & reserved Public IPs. Use
aws ec2 terminate-instances when you are truly done.
aws s3 sync --delete Without --dryrun
The --delete flag deletes anything in the destination that isn't in your
source folder. Always preview with --dryrun first so you don't wipe
production data.