AWS Core Reference

AWS Core Services: IAM, S3, EC2 & VPC Cheat Sheet

The four pillars of Amazon Web Services in one desk-side sheet: how IAM controls who gets in, VPC draws the network walls, EC2 runs your servers, and S3 stores your files.

โฑ๏ธ 8 min scan๐ŸŸข Beginner Friendly๐Ÿ“… Updated: 2026
๐Ÿ—บ๏ธ How AWS Core Services Fit Together (Region โ†’ VPC โ†’ Subnets โ†’ EC2 & S3)
๐ŸŒ Internet Users / CLI AWS Region (e.g. us-east-1) VPC (Virtual Private Cloud) 10.0.0.0/16 IGW Gateway Public Subnet (10.0.1.0/24) Route โ†’ IGW ๐Ÿ–ฅ๏ธ EC2 (Web) Public IP + SG ๐Ÿ”€ NAT Gateway Outbound Only Private Subnet (10.0.2.0/24) Route โ†’ NAT ๐Ÿ—„๏ธ EC2 / RDS No Public IP ๐Ÿ’พ EBS Volume Block Storage ๐Ÿชฃ Amazon S3 Object Storage (Regional Service) ๐Ÿ” IAM Role Access Backups & Assets

1 IAM Users, Roles, Policies & ARN Anatomy

IAM (Identity and Access Management) is AWS's global bouncer. Every API call is denied by default unless an IAM Policy explicitly allows it.

๐Ÿ‘ค IAM User

A permanent identity for a human or legacy app with a password or long-lived Access Keys. Group users into IAM Groups to manage permissions cleanly.

๐ŸŽญ IAM Role

A temporary hat assumed by EC2, Lambda, or another AWS account. Uses short-lived tokensโ€”no hardcoded passwords or keys!

๐Ÿ“œ IAM Policy

A JSON document defining Effect (Allow/Deny), Action (e.g., s3:GetObject), and Resource (ARN).

ARN Anatomy (Amazon Resource Name)

Every AWS resource has a unique global address called an ARN. You will paste ARNs into IAM policies, Terraform configs, and CLI commands.

arn:aws:s3:us-east-1:123456789012:bucket/my-app-logs
Partition arn:aws Standard AWS (or aws-gov)
Service s3 Service name (ec2, iam)
Region us-east-1 Blank for global (S3/IAM)
Account ID 123456789012 12-digit AWS account
Resource bucket/my-app-logs Specific resource ID/path

Essential IAM CLI Commands

aws sts get-caller-identity
Check "Who Am I?"
Shows your active AWS Account ID, User/Role ARN, and UserID.
aws iam list-users --output table
List IAM Users
Displays all IAM users in the account as a readable table.
aws iam list-attached-user-policies --user-name dev-alice
Inspect User Permissions
Lists managed policies directly attached to a specific IAM user.
aws iam attach-role-policy --role-name ec2-s3-role --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
Attach Policy to Role
Grants an IAM Role read-only access to S3 using an AWS managed policy.
๐Ÿง  Memory Trick: Explicit Deny Always Wins

In IAM evaluation: Explicit Deny > Explicit Allow > Implicit Deny. Even if a user has AdministratorAccess, one single "Effect": "Deny" statement on an action blocks it completely.

2 EC2 Instances, Security Groups vs NACLs & EBS

EC2 (Elastic Compute Cloud) gives you virtual servers. Every EC2 instance needs a firewall (Security Group) and virtual hard drives (EBS Volumes).

Security Groups (SG) vs Network ACLs (NACL)

Feature Security Group (SG) Network ACL (NACL)
Scope Instance / ENI level (wraps around EC2) Subnet level (wraps around the entire subnet)
Statefulness Stateful (return traffic is auto-allowed) Stateless (must allow inbound AND outbound)
Rule Types Allow rules only (default deny all) Allow AND Deny rules (processed by rule #)
Evaluation Evaluates all rules before deciding Evaluates in numerical order (lowest # wins)
Best Used For Everyday app ports (HTTP 80, HTTPS 443, SSH 22) Blocking specific malicious IP ranges at subnet edge

๐Ÿ’พ EBS (Elastic Block Store)

Persistent network-attached hard drives for EC2 (like gp3 SSD). Tied to a single Availability Zone. Back up with EBS Snapshots (stored in S3).

๐Ÿท๏ธ EC2 Instance Families

t3/t4g = General burstable ยท c6i = Compute heavy ยท r6i = Memory/RAM heavy ยท g5 = GPU/AI.

Essential EC2 CLI Commands

aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId,State.Name,PublicIpAddress]" --output table
List EC2 Instances & IPs
Clean table of Instance ID, running/stopped state, and Public IP.
aws ec2 run-instances --image-id ami-0c55b159cbfafe1f0 --instance-type t3.micro --key-name my-key --security-group-ids sg-01234567
Launch a New EC2 Instance
Creates a Free-Tier eligible t3.micro server with SSH key & SG.
aws ec2 authorize-security-group-ingress --group-id sg-01234567 --protocol tcp --port 443 --cidr 0.0.0.0/0
Open HTTPS (Port 443)
Adds an inbound rule allowing public HTTPS traffic to your Security Group.
aws ec2 create-snapshot --volume-id vol-0123456789abcdef0 --description "Pre-upgrade backup"
Snapshot an EBS Volume
Takes an incremental point-in-time backup of your EC2 disk.

3 S3 Storage Classes & CLI Commands

Amazon S3 (Simple Storage Service) stores unlimited objects (files) up to 5 TB each with 99.999999999% (11 nines) durability. Bucket names must be globally unique.

Storage Class Best Use Case Min Storage Retrieval Speed
S3 Standard Frequently accessed data, websites, active apps None Milliseconds
S3 Intelligent-Tiering Unknown or changing access patterns (auto-moves tiers) None Milliseconds
S3 Standard-IA Infrequently accessed backups, disaster recovery 30 days Milliseconds (per-GB fee)
S3 One Zone-IA Re-creatable secondary backups (single AZ only) 30 days Milliseconds (cheaper)
S3 Glacier Instant Rarely accessed archives needing instant read (medical/media) 90 days Milliseconds
S3 Glacier Flexible Yearly archives, compliance logs 90 days Minutes to Hours
S3 Glacier Deep Archive 7โ€“10 year legal/regulatory retention (lowest cost) 180 days 12โ€“48 Hours

Essential S3 Copy & Sync Commands

aws s3 mb s3://shekharit-demo-2026 --region us-east-1
Create an S3 Bucket
mb = Make Bucket. Name must be globally unique & lowercase.
aws s3 cp ./backup.tar.gz s3://shekharit-demo-2026/backups/ --storage-class STANDARD_IA
Upload File to Specific Tier
Copies a local file to S3 and places it directly in Infrequent Access.
aws s3 sync ./dist s3://shekharit-demo-2026/site --dryrun
Preview Folder Sync
Uploads only new/changed files. Always test with --dryrun first.
aws s3 presign s3://shekharit-demo-2026/report.pdf --expires-in 900
Generate Temporary Share URL
Creates a time-limited (15 min) download link for a private S3 object.

4 VPC Essentials: Subnets, IGW, NAT & CIDR

A VPC (Virtual Private Cloud) is your isolated private network inside an AWS Region. You split its IP range (CIDR block) into Subnets across Availability Zones.

๐Ÿšช Internet Gateway (IGW)

Two-way door between your VPC and the public internet. Required for any Public Subnet.

๐Ÿ”€ NAT Gateway

One-way door in a Public Subnet that lets Private Subnet servers download updates without exposing them to inbound internet traffic.

๐Ÿงญ Route Tables

The GPS for each subnet. 10.0.0.0/16 โ†’ local stays inside the VPC; 0.0.0.0/0 โ†’ igw-xxx goes to the internet.

๐Ÿ”ข CIDR Block Math

/16 = 65,536 IPs (typical VPC). /24 = 256 IPs (251 usable in AWS, since AWS reserves 5 IPs per subnet).

๐Ÿง  Memory Trick: Public vs Private Subnet

A subnet is NOT public just because you named it "public-subnet"! A subnet is only Public if its Route Table has a route 0.0.0.0/0 โ†’ igw-xxxx (Internet Gateway). If it routes 0.0.0.0/0 โ†’ nat-xxxx (or has no internet route), it is a Private subnet.

aws ec2 describe-vpcs --output table
List VPCs & CIDR Blocks
Shows all VPC IDs and their IPv4 CIDR ranges in the current region.
aws ec2 describe-subnets --query "Subnets[*].[SubnetId,VpcId,CidrBlock,AvailabilityZone]" --output table
Inspect Subnets & AZs
Lists every subnet, its parent VPC, CIDR range, and Availability Zone.

5 Danger Zone: Critical AWS Mistakes

โš ๏ธ Security & Cost Traps to Avoid
1. Using the AWS Root Account for Daily Work

The Root account has unrestricted access to everything, including closing your account or deleting billing history. Enable MFA on Root, lock away its credentials, and use an IAM Admin user or IAM Identity Center instead.

2. Opening SSH (22) or RDP (3389) to 0.0.0.0/0

Allowing 0.0.0.0/0 on port 22 or 3389 exposes your server to automated brute-force bots within minutes. Restrict SSH/RDP to your specific office/home IP (/32), or better yet, use AWS Systems Manager Session Manager with zero open inbound ports.

3. Unencrypted or Publicly Readable S3 Buckets

Keep S3 Block Public Access enabled at the account level. Always verify default encryption (SSE-S3 or SSE-KMS) is active so sensitive backups, customer PII, or logs are never exposed to the public internet.

4. Leaving Idle NAT Gateways & Unattached EBS Volumes

A NAT Gateway charges ~$32/month per AZ even with zero traffic, and unattached EBS volumes continue billing after EC2 termination. Clean up unused NAT Gateways and orphaned volumes in lab accounts.