Amazon S3 (Simple Storage Service) is usually the first AWS service learners use after EC2. It stores files of any type, from website images to log files and database backups, and it is used by almost every company on AWS.
The basic terms
- Bucket: a container for files. Bucket names are globally unique across all AWS accounts, and each bucket lives in one region.
- Object: a file plus its metadata. Each object has a key, which is its full name, such as
reports/2026/november.csv. - Prefix: S3 has no real folders. The “folders” you see in the console are just parts of object keys separated by slashes.
Permissions: private by default
New buckets are private, and Block Public Access is switched on. Keep it on unless you have a specific reason, such as hosting a public static website. Many real data leaks happened because someone made a bucket public “just for testing”.
Access is controlled mainly through:
- IAM policies attached to users or roles, which say what they may do in S3.
- Bucket policies attached to the bucket, which say who may access it.
For an application running on EC2, attach an IAM role to the instance rather than storing access keys in your code.
Storage classes and lifecycle rules
S3 offers several storage classes. Standard is for data you read often; Infrequent Access and Glacier classes cost less to store but more to retrieve. Lifecycle rules can move old objects to cheaper classes automatically or delete them after a set number of days, which is how teams keep log storage costs under control.
A first hands-on exercise
- Create a bucket in your nearest region with Block Public Access on.
- Upload a few files under two different prefixes.
- Turn on versioning, upload a changed version of a file, and restore the old one.
- Add a lifecycle rule that deletes objects under
temp/after 7 days. - Use the AWS CLI:
aws s3 ls s3://your-bucket/andaws s3 cp.
Stay within the free tier and delete test buckets when you finish. Next, read AWS IAM explained and AWS EC2 for beginners.
S3, EC2 and IAM are covered with labs in our AWS and DevOps course in Bangalore.
Book a free demo class at our BTM Layout centre, and ask a counsellor for batch details.
