AWS S3 Deep Dive Cheat Sheet
Comprehensive reference for S3 bucket operations, storage classes, lifecycle rules, and access control via CLI and policies.
2 PagesIntermediateFeb 10, 2026
CLI Basics
Core bucket and object operations.
bash
aws s3 mb s3://my-unique-bucket-name # Create bucketaws s3 ls # List bucketsaws s3 ls s3://my-unique-bucket-name/ # List objectsaws s3 cp file.txt s3://my-bucket/file.txt # Uploadaws s3 cp s3://my-bucket/file.txt ./ # Downloadaws s3 sync ./local-dir s3://my-bucket/prefix # Sync directoryaws s3 rm s3://my-bucket/file.txt # Delete objectaws s3 rb s3://my-bucket --force # Delete bucket + contents
Bucket Policy (JSON)
Grant public read access to a specific prefix.
json
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::my-bucket/public/*" } ]}
Lifecycle Rule (CLI)
Transition and expire objects automatically.
bash
aws s3api put-bucket-lifecycle-configuration \ --bucket my-bucket \ --lifecycle-configuration '{ "Rules": [{ "ID": "ArchiveOldObjects", "Status": "Enabled", "Filter": {"Prefix": "logs/"}, "Transitions": [{"Days": 30, "StorageClass": "GLACIER"}], "Expiration": {"Days": 365} }] }'
Storage Classes
Key storage classes to know.
- S3 Standard- Default, low-latency, frequently accessed data
- S3 Intelligent-Tiering- Auto-moves objects between tiers based on access patterns
- S3 Standard-IA- Infrequent access, lower storage cost, retrieval fee applies
- S3 One Zone-IA- Like Standard-IA but stored in a single AZ, cheaper, less durable
- S3 Glacier Instant Retrieval- Archive tier with millisecond retrieval
- S3 Glacier Deep Archive- Lowest cost, retrieval takes hours, for long-term archival
Key Features
Key key features to know.
- Versioning- Keeps multiple variants of an object to protect against overwrite/delete
- Presigned URL- Time-limited URL granting temporary access without IAM credentials
- Server-Side Encryption- SSE-S3, SSE-KMS, or SSE-C encrypt objects at rest
- Cross-Region Replication- Automatically copies objects to a bucket in another region
- Event Notifications- Trigger Lambda/SQS/SNS on object create/delete events
Pro Tip
Enable S3 Intelligent-Tiering on buckets with unpredictable access patterns instead of manually writing lifecycle rules — it automatically moves objects between access tiers with no retrieval fees or operational overhead.
Was this cheat sheet helpful?
Explore Topics
#AWSS3DeepDive#AWSS3DeepDiveCheatSheet#CloudComputing#Intermediate#CLIBasics#BucketPolicyJSON#LifecycleRuleCLI#StorageClasses#OOP#CommandLine#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance