Amazon S3 (Simple Storage Service) is presented as an AWS cloud object storage service for storing and retrieving data such as images, videos, documents, log files, backups, and static website assets from anywhere. The articles explain that S3 organizes data using buckets and objects: a bucket acts like a container (with globally unique bucket names), while any stored file within a bucket is an object. S3 is described as highly durable, highly available, scalable, secure, and cost-effective, with benefits including automatic scaling and security controls. Storage classes are introduced to match access patterns, ranging from S3 Standard for frequently accessed data to S3 Standard-IA for infrequent access, one-zone variants, and S3 Glacier for archival storage with slower retrieval. Versioning is covered as a way to preserve older copies of objects when files are updated. A hands-on walkthrough then shows creating an S3 bucket, uploading files, enabling bucket versioning, creating an IAM user, and granting access via IAM permissions and bucket policies. For static website hosting, the walkthrough enables S3 static website hosting, addresses access being blocked (403 errors) by adjusting Block Public Access settings and adding a bucket policy that allows public GetObject for the bucket’s objects, then loads the website using the provided endpoint.
Amazon S3 for beginners: buckets, objects, versioning, permissions, and static website hosting
Amazon S3 (Simple Storage Service) is presented as an AWS cloud object storage service for storing and retrieving data such as images, videos, documents, log files, backups, and static website assets...
- Amazon S3 stores data as objects inside buckets; bucket names must be globally unique.
- S3 provides durability, availability, scalability, security features, and charges based on storage and requests.
- S3 supports versioning to preserve previous object versions after updates.
- Access to S3 is controlled using IAM permissions and bucket permissions such as bucket policies and Block Public Access settings.
- S3 can host static websites by uploading files (e.g., index.html) and configuring Static Website Hosting plus appropriate object access permissions.
Introduction In the previous article, we learned the theory behind Amazon S3. Now it is time to see Amazon S3 in action. In this hands-on project, we will: Create an S3 bucket Upload files Understand Objects inside S3 Enable Bucket Versioning Create IAM User Control access using Bucket Policies Host a Static Website using S3 By the end of this article, we will understand some of the most commonly used Amazon S3 features. Step 1: Create an S3 Bucket Login to AWS Console. Search for S3. Open the dashboard. Click on Create Bucket. Provide: Bucket Name Give your bucket a name, for example: my-learning-notes-example Bucket names must be globally unique. For now, leave all the remaining settings as default. Click on Create Bucket. Step 2: Explore the Bucket Open the bucket you just created. Initially, you will notice: Objects (0) because the bucket is empty. Think of a bucket as a folder that stores files. Step 3: Upload Your First Object Click on: Upload Then click: Add files Choose any file. Click: Upload After the upload finishes, you will see the file inside the bucket. In Amazon S3, every uploaded file is called an Object. Now if you look inside the bucket, you will notice that Objects are no longer zero because we have uploaded a file. Step 4: Explore Object Options Click on the uploaded Object. Explore the options: Open Select the file and click Open. It will display the contents of the file. Download Select the file and click Download. The file will be downloaded to your system. Delete If you select Delete, AWS will ask for confirmation before deleting the object. This helps you understand how S3 manages objects. Step 5: Enable Bucket Versioning Suppose you upload: demo-learning-s3.txt Later, you modify the file and upload it again. Without versioning, the old file gets overwritten. Versioning allows you to preserve previous versions. Go to: Bucket → Properties Scroll to: Bucket Versioning Click: Edit Choose: Enable Click: Save Changes Now if you check the bucket properties, you can see that versioning is enabled. Step 6: Upload a New Version Modify your file. Before AWS S3 Notes version 1 After AWS S3 Notes version 2 Upload the file again using the same filename. Now open the Object. Click: Versions You will see multiple versions. This is similar to maintaining history in Git. Step 7: Create an IAM User In AWS Console, search for: IAM Go to: IAM → Users → Create User Give a name: demo-s3-user Assign a password. Click: Create User Step 8: Verify Permissions Open an Incognito browser. Login using the IAM user credentials. Try accessing the Amazon S3 bucket. Also try creating a bucket. Initially, you will receive permission errors. This happens because the user has no S3 permissions. Step 9: Grant S3 Permissions Login as the root/Admin user. Open: IAM → Users → demo-s3-user Click: Add Permissions Attach: AmazonS3FullAccess Click: Save Now refresh the IAM user session. The demo-s3-user can now access S3. Step 10: Explore Bucket Permissions Open: S3 → Bucket → Permissions You will notice: Bucket Policies Block Public Access Access Control These settings provide an additional security layer. Even if IAM permissions are accidentally misconfigured, Bucket Policies can still protect your bucket. Step 11: Enable Static Website Hosting Create a simple index.html file. Upload this file to your bucket. Now go to: Bucket → Properties Scroll to: Static Website Hosting Click: Edit Enable: Static Website Hosting Set: Index Document: index.html Click: Save Changes AWS will generate a website endpoint. Try accessing the website endpoint URL. You will notice that you still cannot access it even if you have S3 Full Access. This happens because there are still S3 permissions blocking public access. Step 12: Remove Public Access Block Go to: Permissions Locate: Block Public Access Click: Edit Disable public access. Confirm the warning. When you try to access the URL again, you may still receive: 403 Forbidden Although Static Website Hosting is enabled, the files inside the bucket are still private. AWS requires explicit permission before users on the internet can read objects inside an S3 bucket. To solve this, we need to create a Bucket Policy. Step 13: Add Bucket Policy for Public Read Go to: Permissions → Bucket Policy → Edit Click: Add New Statement Initially, AWS provides a template similar to: { "Version": "2012-10-17", "Statement": [ { "Sid": "Statement1", "Principal": {}, "Effect": "Allow", "Action": [], "Resource": [] } ] } We need to fill these values. Understanding the Fields Sid Used to identify the policy statement. "Sid": "PublicReadGetObject" Principal Defines who the rule applies to. "Principal": "*" The * means anyone on the internet. Effect Specifies whether AWS should allow or deny the action. "Effect": "Allow" Action Defines which permission we are granting. "Action": "s3:GetObject" This allows users to read objects inside the bucket. Resource Specifies which bucket objects the rule applies to. Example: "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*" Replace YOUR_BUCKET_NAME with your actual bucket name. The /* means apply the rule to all objects inside the bucket. My bucket name is: my-learning-notes-example Therefore, the policy becomes: { "Version": "2012-10-17", "Statement": [ { "Sid": "Statement1", "Principal": "*", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::my-learning-notes-example/*" } ] } Click: Save Changes Note: Replace my-learning-notes-example with your own bucket name. Step 14: Access the Website Go back to: Bucket → Properties Scroll down to: Static Website Hosting Copy the: Bucket Website Endpoint URL Paste it into your browser. Now, instead of receiving the 403 Forbidden error, your webpage should load successfully. Congratulations 🎉 You have successfully hosted your first static website using Amazon S3. Key Takeaways In this hands-on project, we learned how to: ✅ Create an S3 bucket ✅ Upload objects ✅ Understand bucket and object concepts ✅ Enable versioning ✅ Create IAM users ✅ Understand permissions ✅ Explore bucket policies ✅ Host a static website What's Next? In the next article, we will explore another important AWS service and continue building our cloud learning journey.
18 hours agoIntroduction In the previous articles, we explored AWS networking concepts like: VPC Subnets Internet Gateway Security Groups Route 53 Now, let's move to one of the most popular AWS services: Amazon S3 (Simple Storage Service) Amazon S3 is one of the easiest AWS services to learn and one of the most widely used services in real-world applications. Almost every application stores some kind of data: Images Videos Documents Log files Backups Static websites Amazon S3 helps us store and retrieve these files securely from anywhere in the world. In this article, we will understand: What Amazon S3 is Buckets and Objects Benefits of S3 Storage Classes Versioning Basic security concepts Static website hosting overview Why Do We Need Storage? Imagine you are running an online photo-sharing application. Users upload: Profile pictures Photos Videos Where should these files be stored? Keeping them directly inside application servers is not a good idea because: Storage is limited. Scaling becomes difficult. Replacing servers may cause data loss. This is where Amazon S3 helps. What is Amazon S3? Amazon S3 stands for: Simple Storage Service It is a cloud-based object storage service provided by AWS. S3 allows us to: Store data Retrieve data Manage data from anywhere using the internet. Amazon S3 is designed to be: Highly available Durable Scalable Secure Cost-effective Real-World Example Think of Amazon S3 as a digital warehouse. Suppose you own an e-commerce company. Inside your warehouse, you store: Product images Invoices Customer documents Videos Similarly, Amazon S3 stores digital files safely in the cloud. Buckets and Objects Amazon S3 stores data using two concepts: Bucket A bucket is a container used to store files. Think of a bucket like a folder. Examples: company-documents customer-images application-logs Bucket names must be globally unique. Object Anything stored inside a bucket is called an Object. Examples: invoice.pdf profile.jpg backup.zip video.mp4 Objects can contain: Images Videos HTML files CSV files JSON files Log files Almost any file type can be stored in S3. Real-Life Example Cupboard (Bucket) ↓ Files and Documents (Objects) Similarly: S3 Bucket ↓ Objects Benefits of Amazon S3 1. High Durability Amazon S3 is famous for its durability. AWS provides: 99.999999999% durability. This is often called: Eleven 9's of Durability AWS automatically keeps multiple copies of your data to prevent data loss. 2. High Availability S3 is designed to remain accessible even if some infrastructure components fail. Applications can continue accessing files without interruption. 3. Scalability You don't need to estimate storage in advance. Whether you store: 10 files 10 million files Amazon S3 automatically scales. 4. Security AWS provides multiple security mechanisms: IAM Policies Bucket Policies Encryption Access Control These help protect sensitive data. 5. Cost Effective You only pay for: Storage used Requests made There is no need to purchase storage hardware. 6. High Performance Amazon S3 supports: Parallel uploads Multipart uploads This improves performance for large files. S3 Storage Classes Not every file needs the same level of access. AWS provides different storage classes. S3 Standard Used for frequently accessed files. Examples: Website images Application assets S3 Standard-IA IA stands for: Infrequent Access Used for files accessed occasionally. Examples: Monthly reports Older documents One Zone-IA Stores data in a single Availability Zone. Cheaper but less resilient. Suitable for: Backup copies Temporary files S3 Glacier Used for long-term archival storage. Examples: Old backups Compliance records Retrieval is slower but storage cost is very low. What is Versioning? Suppose today you upload: report.csv Tomorrow, you modify the same file and upload it again. What if you later discover that yesterday's version was correct? Versioning helps solve this problem. When versioning is enabled: Old versions are preserved. New uploads create new versions. Previous files can be restored. Real-Life Example Think about Git. Every commit stores history. Similarly, S3 Versioning stores file history. Static Website Hosting Amazon S3 can also host static websites. Examples: Portfolio websites Documentation sites Landing pages Files like: index.html style.css logo.png can be served directly from S3. Because static websites do not require servers, S3 hosting is: Simple Fast Low cost Understanding S3 Security AWS provides multiple layers of security. Examples: IAM Policies Control what users can do. Bucket Policies Control who can access a bucket. Encryption Protects stored data. Even if IAM permissions are accidentally configured incorrectly, bucket policies can provide an additional security layer. Common Use Cases of Amazon S3 Amazon S3 is used for: Image storage Video storage Backup and recovery Application logs Static website hosting Data archival Data lakes Big data workloads Official AWS Documentation If you'd like to explore S3 in more detail, AWS provides excellent documentation. Amazon S3 Documentation https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html Amazon S3 Overview https://aws.amazon.com/s3/ Conclusion Amazon S3 is one of the most important AWS services and is widely used in almost every cloud application. In this article, we learned: What Amazon S3 is Buckets and Objects Benefits of S3 Storage Classes Versioning Security concepts Static website hosting overview In the next article, we will perform hands-on exercises and: Create S3 buckets Upload files Enable versioning Configure permissions Create IAM users Host a static website using Amazon S3
18 hours ago
U.S. says Strait of Hormuz transit is toll-free under Iran deal, subject to commitments
The United States says a memorandum of understanding with Iran will allow ships to pass through the Strait of Hormuz wit...
Ukrainian drones strike Moscow oil refinery again amid Russia missile attacks on Kyiv
Ukrainian drones strike a Moscow oil refinery for the second time this week, while Russia launches missile attacks into...
Spanish court orders Pedro Sánchez’s wife Begoña Gómez to stand trial
A Spanish court in Madrid orders Begoña Gómez, the wife of Prime Minister Pedro Sánchez, to stand trial following a judg...