All Cheat Sheets

Compute Cheat Sheet

Multi-cloud reference for AWS, Azure, and Google Cloud Compute services

Key Commands & CLI Operations

CommandDescription
aws ec2 run-instances --image-id ami-0c55b159cbfafe1f0 --count 1 --instance-type t4g.medium --key-name my-key --security-group-ids sg-12345 --subnet-id subnet-abcLaunch an EC2 Graviton instance
aws ec2 describe-instances --filters 'Name=instance-state-name,Values=running'List running instances
aws ec2 stop-instances --instance-ids i-1234567890abcdef0Stop an instance
aws ec2 create-image --instance-id i-1234567890abcdef0 --name 'Golden-AMI-v2' --no-rebootCreate customized AMI snapshot

Architectural Key Facts

  • Foundational IaaS compute service powered by the AWS Nitro System for near-zero hypervisor overhead.
  • Broad architecture choices: AWS Graviton (ARM64), Intel Xeon (x86_64), AMD EPYC, and NVIDIA GPU instances.
  • Purchase models: On-Demand, Savings Plans (up to 72% discount), Reserved Instances, and Spot (up to 90% discount with 2-min warning).
  • Auto Scaling Groups (ASGs) maintain fleet availability across AZs with Target Tracking and Predictive Scaling.
  • EC2 Instance Connect and SSM Session Manager enable secure shell access without opening inbound port 22.

Production Limits & Quotas

Item / DimensionLimit / Quota
Default running On-Demand vCPU quotaStandard (A, C, D, M, R, T, Z) typically 64+ vCPUs
Max ENIs attached per instanceVaries by instance size (e.g. c7g.16xlarge supports 15 ENIs)
Security Groups per ENI5 Security Groups default

AWS Fargate / ECS

AWS
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
aws ecs run-task --cluster prod-cluster --task-definition web-api:3 --launch-type FARGATE --network-configuration 'awsvpcConfiguration={subnets=[subnet-1,subnet-2],securityGroups=[sg-web],assignPublicIp=ENABLED}'Launch serverless Fargate container task
aws ecs update-service --cluster prod-cluster --service web-api-svc --force-new-deploymentTrigger zero-downtime rolling update
aws ecs register-task-definition --cli-input-json file://task-def.jsonRegister new task revision

Architectural Key Facts

  • Serverless container compute engine compatible with both Amazon ECS and Amazon EKS.
  • Eliminates EC2 VM provisioning, patching, OS hardening, and cluster bin-packing management.
  • Tasks run in dedicated Firecracker-isolated microVM kernels with task-level IAM execution roles.
  • Each task receives an Elastic Network Interface (awsvpc networking) with full VPC security group enforcement.
  • Fargate Spot offers up to 70% discount for interruption-tolerant background jobs.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max task vCPU configuration16 vCPUs
Max task memory configuration120 GB RAM
Ephemeral storage limitConfigurable up to 200 GiB

Key Commands & CLI Operations

CommandDescription
aws eks update-kubeconfig --region us-east-1 --name prod-clusterConfigure local kubectl credentials
aws eks create-nodegroup --cluster-name prod-cluster --nodegroup-name arm-workers --instance-types t4g.xlarge --node-role arn:aws:iam::123:role/NodeRole --subnets subnet-1 subnet-2Create managed node group
kubectl get nodes -o wideList cluster node health and IPs
aws eks describe-cluster --name prod-cluster --query 'cluster.status'Check control plane status

Architectural Key Facts

  • Certified Kubernetes-conformant managed control plane replicated across 3 Availability Zones.
  • AWS VPC CNI assigns native private VPC IP addresses directly to Kubernetes Pods for line-rate routing.
  • IAM Roles for Service Accounts (IRSA) and EKS Pod Identities deliver least-privilege AWS credentials to pods.
  • Karpenter high-performance node autoscaler right-sizes compute in seconds based on pending pod requirements.
  • EKS Auto Mode automates node provisioning, OS patching, VPC networking, and EBS storage drivers.

Production Limits & Quotas

Item / DimensionLimit / Quota
Managed Node Groups per cluster100 nodegroups
Max pods per nodeDepends on instance ENI limits (expandable with prefix delegation to 110+)
Control plane SLA99.95% uptime SLA backed by AWS

Key Commands & CLI Operations

CommandDescription
aws lambda invoke --function-name order-processor --payload '{"order_id":"101"}' response.jsonSynchronously invoke Lambda function
aws lambda create-function --function-name api-handler --runtime python3.11 --role arn:aws:iam::123:role/LambdaRole --handler app.handler --zip-file fileb://code.zipDeploy Zip packaged function
aws lambda update-function-configuration --function-name api-handler --memory-size 1024 --timeout 30Update memory and timeout
aws lambda put-provisioned-concurrency-config --function-name api-handler --qualifier prod --provisioned-concurrent-executions 20Eliminate cold starts with provisioned concurrency

Architectural Key Facts

  • Event-driven serverless compute service running code in millisecond increments with zero server management.
  • Firecracker microVM sandbox provides secure isolation; 1 vCPU is allocated proportionally at 1,769 MB RAM.
  • AWS Hyperplane shared VPC architecture enables sub-40ms ENI connections to RDS and ElastiCache.
  • Three invocation models: Synchronous (API Gateway), Asynchronous with DLQs (S3/SNS), and Poll-based (Kinesis/SQS).
  • Supports lightweight Zip packages (up to 250 MB unzipped) and OCI Container Images up to 10 GB.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max execution duration900 seconds (15 minutes)
Memory allocation range128 MB to 10,240 MB (10 GB) in 1 MB increments
Default regional concurrency limit1,000 concurrent executions (expandable)
Ephemeral `/tmp` storage512 MB to 10,240 MB (10 GB)

Azure Virtual Machines

Azure

Key Commands & CLI Operations

CommandDescription
az vm create -g myrg -n web-vm --image Ubuntu2204 --size Standard_D4s_v5 --admin-username azureuser --generate-ssh-keys --vnet-name prod-vnet --subnet app-subnetLaunch Linux VM with SSH keys in private subnet
az vm open-port -g myrg -n web-vm --port 443Open inbound HTTPS port in Network Security Group
az vm stop -g myrg -n web-vmStop VM (note: still incurs compute charges unless deallocated)
az vm deallocate -g myrg -n web-vmDeallocate VM to release hardware and stop compute billing

Architectural Key Facts

  • On-demand, scalable IaaS computing resources supporting Windows Server, Linux, SQL Server, and Oracle.
  • Azure Hybrid Benefit saves up to 85% by leveraging existing on-premises Windows Server and SQL Server licenses.
  • Proximity Placement Groups physically co-locate VMs within the same data center to achieve sub-millisecond network latency.
  • Spot Virtual Machines offer up to 90% discount for fault-tolerant workloads with 30-second eviction notices.
  • Virtual Machine Scale Sets (VMSS) automatically scale and distribute VM instances across Availability Zones.

Production Limits & Quotas

Item / DimensionLimit / Quota
Regional vCPU quota (default)Typically 20 cores per region (expandable via Azure portal)
Max data disks per VMUp to 64 data disks on largest instance types
Max network bandwidthUp to 200 Gbps on specialized networking instance series

Azure Container Apps

Azure

Key Commands & CLI Operations

CommandDescription
az containerapp env create -n prod-env -g myrg --location eastusCreate Container Apps managed environment
az containerapp create -n api-svc -g myrg --environment prod-env --image myacr.azurecr.io/api:v1 --target-port 80 --ingress external --min-replicas 0 --max-replicas 10Deploy serverless container scaling to zero
az containerapp revision list -n api-svc -g myrg -o tableList immutable revision versions

Architectural Key Facts

  • Fully managed serverless container runtime built on top of Kubernetes, Envoy proxy, and KEDA (Kubernetes Event-driven Autoscaling).
  • Natively scales containers to zero based on HTTP traffic, queue lengths (Kafka/RabbitMQ/Service Bus), or CPU/memory metrics.
  • Supports microservice communication and state management via built-in Distributed Application Runtime (Dapr).
  • Built-in traffic splitting supports zero-downtime blue/green deployments and canary rollouts between revisions.
  • Provides managed secrets, private VNet injection, and automatic HTTPS ingress certificates out of the box.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max CPU per container replica4.0 vCPUs
Max memory per container replica8.0 GiB RAM
Max container apps per environment1,000 apps

Azure Kubernetes Service (AKS)

Azure

Key Commands & CLI Operations

CommandDescription
az aks create -g myrg -n prod-k8s --node-count 3 --node-vm-size Standard_D4s_v5 --enable-managed-identity --network-plugin azureCreate managed Kubernetes cluster with Azure CNI
az aks get-credentials -g myrg -n prod-k8s --adminDownload kubeconfig context for kubectl
az aks scale -g myrg -n prod-k8s --node-count 5Scale worker node pool count
az aks enable-addons -a monitoring -g myrg -n prod-k8sEnable Azure Monitor Container Insights

Architectural Key Facts

  • Fully managed production Kubernetes service; Microsoft manages and patches the master control plane free of charge.
  • Azure CNI networking allocates private VNet IP addresses directly to pods for native corporate network routability.
  • Microsoft Entra ID integration enables native Azure RBAC permissions to control Kubernetes cluster access.
  • Virtual Nodes powered by Azure Container Instances allow bursting compute capacity in seconds without waiting for VM provisioning.
  • Cluster Autoscaler and Horizontal Pod Autoscaler (HPA) automatically adjust cluster capacity to match workload demands.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max nodes per clusterUp to 5,000 nodes (1,000 nodes per node pool)
Max pods per node (Azure CNI)Default 30 (configurable up to 250 pods)
Control plane SLA99.95% uptime SLA with Standard tier

Azure Functions

Azure

Key Commands & CLI Operations

CommandDescription
az functionapp create -g myrg -n order-func -s myaccount --consumption-plan-location eastus --runtime python --runtime-version 3.10 --functions-version 4Deploy Consumption serverless function app
az functionapp deployment source config-zip -g myrg -n order-func --src app.zipDeploy function code package from zip
az functionapp list-consumption-locationsList serverless compute regions

Architectural Key Facts

  • Event-driven serverless compute platform running code triggered by HTTP requests, timers, queues, and event streams.
  • Hosting plans: Consumption (scales dynamically to zero; pay per execution), Premium (pre-warmed instances to eliminate cold starts), and Dedicated (App Service).
  • Durable Functions extension allows writing stateful orchestrations and long-running workflows programmatically in code.
  • Extensive declarative bindings (Input and Output) integrate with Azure services without writing boilerplate SDK connection code.
  • Supports C#, Python, JavaScript, TypeScript, Java, and PowerShell.

Production Limits & Quotas

Item / DimensionLimit / Quota
Consumption plan execution timeoutDefault 5 minutes (configurable up to 10 minutes)
Premium plan execution timeoutDefault 30 minutes (unlimited available)
Memory limit on Consumption1.5 GB RAM per instance

Compute Engine

Google Cloud
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
gcloud compute instances create instance-1 --zone=us-central1-a --machine-type=e2-mediumCreate a VM instance
gcloud compute ssh instance-1 --zone=us-central1-aSSH into instance
gcloud compute instances stop instance-1 --zone=us-central1-aStop an instance
gcloud compute instances listList all instances

Architectural Key Facts

  • IaaS offering providing secure and customizable virtual machines.
  • Preemptible and Spot VMs offer up to 91% discount for fault-tolerant workloads.
  • Live migration keeps VMs running during host system updates (no downtime).
  • Custom machine types allow precise sizing of vCPU and memory to optimize costs.
  • Sustained use discounts automatically apply when a VM runs for a significant portion of a month.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max vCPUs per custom VMUp to 224 (M2 series) or higher depending on family
Max memory per custom VMUp to 12 TB (M2 series)
Max persistent disks per VM128

Cloud Run

Google Cloud
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
gcloud run deploy --image gcr.io/project/image --platform managedDeploy a container
gcloud run services listList services
gcloud run services update SERVICE --concurrency=80Update concurrency limit
gcloud run domain-mappings create --service SERVICE --domain example.comMap a custom domain

Architectural Key Facts

  • Fully managed serverless platform for deploying containerized applications.
  • Scales automatically from 0 to N based on traffic.
  • You are billed only for the exact compute time used while processing a request (minimum 100ms).
  • Supports any language or library, as long as it can run in a container and listen on a port.
  • Cloud Run Jobs allows running run-to-completion scripts or batch processes.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max request timeout60 minutes
Max memory per instance32 GB
Max vCPU per instance8 vCPU
Max concurrent requests per instance1000

GKE

Google Cloud
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
gcloud container clusters create cluster-name --num-nodes=3 --zone=us-central1-aCreate a GKE cluster
gcloud container clusters get-credentials cluster-name --zone=us-central1-aGet kubeconfig for kubectl
kubectl get pods --all-namespacesList all pods
kubectl apply -f deployment.yamlApply a configuration

Architectural Key Facts

  • Managed Kubernetes service for running containerized applications at scale.
  • Standard mode provides full control over underlying node infrastructure.
  • Autopilot mode manages the entire cluster infrastructure, you only pay for pod resources.
  • Supports Node Auto-provisioning, Cluster Autoscaler, and Horizontal/Vertical Pod Autoscalers.
  • Integrates deeply with GCP IAM and VPC natively.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max nodes per cluster (Standard)15,000
Max pods per node110 (configurable up to 256)
Max pods per cluster150,000