惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Martin Fowler
Martin Fowler
I
InfoQ
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
B
Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
V
Visual Studio Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
AWS S3 Hands-On Project | Buckets, Versioning, Permission...
Vijaya Laxmi Kadham · 2026-06-20 · via DEV Community

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.