What You Will Learn
Beginner
- How to create an S3 bucket
- How to upload and download objects
- How S3 permissions work
S3 (Simple Storage Service) is AWS object storage. Store files (images, videos, backups, logs) with 99.999999999% durability. Pay per GB stored + per request.
Key Concepts
| Term | Meaning |
|---|---|
| Bucket | Container for objects (like a folder). Name must be globally unique. |
| Object | A file (image, document, etc.) + metadata |
| Region | Where the bucket is stored |
Create a Bucket and Upload
Terminalbash
# Create a bucket
aws s3 mb s3://my-unique-bucket-name-123
# Upload a file
aws s3 cp photo.jpg s3://my-unique-bucket-name-123/
# List objects
aws s3 ls s3://my-unique-bucket-name-123/
# Download a file
aws s3 cp s3://my-unique-bucket-name-123/photo.jpg ./downloaded.jpgBucket names are globally unique
No two AWS accounts can have the same bucket name. s3://my-bucket is taken — add a suffix like s3://my-bucket-imcseian-2026.S3 Storage Classes
| Class | Use case | Price |
|---|---|---|
| Standard | Frequently accessed | $$ |
| Infrequent Access | Rarely accessed | $ (cheaper) |
| Glacier | Archives (rarely accessed) | $ (cheapest, slow retrieval) |
Practical Exercise
Create an S3 bucket:
aws s3 mb s3://YOUR-NAME-test-bucketUpload a file:
aws s3 cp myfile.txt s3://YOUR-NAME-test-bucket/List objects:
aws s3 ls s3://YOUR-NAME-test-bucket/Download it back:
aws s3 cp s3://YOUR-NAME-test-bucket/myfile.txt ./downloaded.txtDelete everything and remove the bucket when done
Key Takeaways
- S3 = object storage, 99.999999999% durability.
- Buckets are globally unique; objects are files.
- Free tier: 5 GB storage, 20K GET, 2K PUT requests.
- Storage classes: Standard (frequent), IA (rare), Glacier (archive).
- Always clean up — S3 charges per GB stored.
Comments
Comments
Post a Comment