This master reference cheat sheet compiles the most essential, high-frequency command-line operations across the AWS CLI, Kubernetes (kubectl), Terraform, and core architectural port definitions for fast workplace and examination review.
# List all S3 buckets in account
aws s3 ls
# Sync local directory to S3 bucket recursively
aws s3 sync ./dist s3://my-cloud-bucket/ --delete
# Describe running EC2 instances with public IPs
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" \
--query "Reservations[*].Instances[*].[InstanceId,PublicIpAddress,Tags[?Key=='Name'].Value|[0]]" \
--output table
# Invoke AWS Lambda function directly from terminal
aws lambda invoke --function-name MyFunction --payload '{"key": "value"}' response.json
# Invalidate CloudFront edge cache globally
aws cloudfront create-invalidation --distribution-id E123456789ABCD --paths "/*"
# Get all pods, services, and deployments in all namespaces
kubectl get all -A
# Inspect detailed events and health status of a specific pod
kubectl describe pod my-app-7d9b4c-xyz -n production
# Stream live container logs in real time
kubectl logs -f my-app-7d9b4c-xyz -c web-container --tail=100
# Open interactive bash shell inside a running pod container
kubectl exec -it my-app-7d9b4c-xyz -- /bin/sh
# Scale deployment horizontally to 10 replicas
kubectl scale deployment/web-api --replicas=10
# Perform rolling restart of a deployment
kubectl rollout restart deployment/web-api
# Initialize provider plugins and remote S3 backend
terraform init
# Format all HCL files in current directory to canonical standard
terraform fmt -recursive
# Validate syntax and internal consistency
terraform validate
# Preview proposed infrastructure changes (diff)
terraform plan -out=tfplan.binary
# Apply execution plan to live cloud provider
terraform apply tfplan.binary
# View current live state resources
terraform state list
# Safely tear down all provisioned resources
terraform destroy
| Port | Protocol / Service | Architectural Security Context |
|---|---|---|
| 22 | SSH (Secure Shell) | Linux instance remote access; lock down to Bastion Host or VPN IPs only. |
| 80 | HTTP | Unencrypted web traffic; typically redirected automatically to Port 443 at ALB. |
| 443 | HTTPS / TLS | Secure encrypted web traffic; standard entry port for public API Gateways & ALBs. |
| 53 | DNS (UDP/TCP) | Domain name resolution (Amazon Route 53, CoreDNS in Kubernetes). |
| 3389 | RDP (Remote Desktop) | Windows Server graphical administration; never expose directly to 0.0.0.0/0. |
| 3306 | MySQL / Aurora | Relational database port; restrict access strictly to application subnets. |
| 5432 | PostgreSQL | Relational database port; keep in private database subnet groups. |
| 6379 | Redis | In-memory cache port (ElastiCache / MemoryDB); isolate from internet. |
| 9092 | Apache Kafka | Event streaming broker port (Amazon MSK). |
Broaden your enterprise cloud architecture and DevOps expertise across our curriculum:
Return to the comprehensive 50-class curriculum roadmap and master all cloud computing domains.
Put cheat sheet CLI commands into practice with complete guided hands-on project labs.
Prepare for senior cloud architect and DevOps engineer technical interviews.
Quick-fire academic viva revision for BCA, B.Tech, and Computer Science university exams.