
Private Cloud Storage π - Creating Your Secure S3 Bucket
Learn to create your first secure S3 bucket, upload files safely, and understand AWS pricing. Build cloud storage habits that keep your data private by default.
Welcome to Day 2 of the AWS Builder Challenge #2Β π! Today you'll create your first piece of cloud infrastructure - a secure Amazon S3 bucket that will store your website files. Don't worry if you've never heard of S3 before, we'll explain everything as we go.
In about 30 minutes, you'll create a private storage bucket in the cloud and upload your first file. We're not just creating storage - we're learning why security comes first in the cloud and how to keep your data private by default.
This means creating a bucket that's locked down from the start, understanding why we never make buckets public, and uploading a photo that will eventually become part of your website. The goal is to build secure cloud storage habits that will serve you well throughout your AWS journey.
By the end of today, you'll have secure cloud storage ready for your website files. Let's get started.
What you will accomplish today
- Create a private Amazon S3 bucket with security best practices
- Learn why S3 buckets should remain private by default
- Upload a photo of yourself to your secure bucket
- Understand S3 security settings and access controls
- Organize your files properly in cloud storage
What you will need:
- Your AWS account from Day 1Β (signed in as your IAM admin user) π»
- A photo of yourself (any format: JPG, PNG, etc.) πΈ
- About 30 minutes of your time β°
Step 1: Understanding Amazon S3
Before we create your bucket, let's understand what S3 is and why it's great for hosting websites.
Amazon S3 (Simple Storage Service) is like having unlimited, secure file storage in the cloud. Think of it as a super-powered version of Dropbox, but designed for applications and websites.
Key concepts:
- Bucket - A container for your files (like a folder, but at the top level)
- Object - Any file you store in a bucket (photos, HTML files, videos, etc.)
- Private by default - New buckets block all public access for security
Why S3 for websites?
- Stores your HTML, CSS, images, and other website files
- Scales automatically as your site grows
- Integrates well with other AWS services
- Pay-as-you-go pricing based on usage
Step 2: Create your private S3 bucket
Let's create your secure storage bucket. Remember, we're keeping it private - this is a security best practice.
- Navigate to S3 - In the AWS Console, search for "S3" in the top search bar and click on it
- Create a new bucket - Click the orange "Create bucket" button
- Choose a unique bucket name - Enter a name like "my-first-website-[your-name]" (example: "my-first-website-ana")
- Keep default security settings - Under "Block Public Access settings for this bucket", ensure all four checkboxes are checked β
- β
Block all public access (recommended - this enables all four settings below)
- β Block public access to buckets and objects granted through new access control lists (ACLs)
- β Block public access to buckets and objects granted through any access control lists (ACLs)
- β Block public access to buckets and objects granted through new public bucket or access point policies
- β Block public access to buckets and objects granted through any public bucket or access point policies
- β
Block all public access (recommended - this enables all four settings below)
- Skip other settings - Leave all other settings as default for now
- Create the bucket - Click "Create bucket" at the bottom
Step 3: Upload your photo
Now let's add your first file to the bucket - a photo that will become part of your website.
- Open your bucket - Click on your bucket name to enter it
- Upload a file - Click the "Upload" button
- Add your photo - Click "Add files" and select a photo of yourself from your computer
- Any common image format works (JPG, PNG, GIF, etc.)
- Keep the file size reasonable (under 5MB is plenty)
- Review upload settings - You'll see your file listed. The default settings are perfect for now
- Upload the file - Click "Upload" at the bottom
Step 4: Explore your bucket and understand security
Let's explore what you've created and understand the security features protecting your data.
- View your uploaded file - Click on your photo's name to see its details
- Check the Object URL - You'll see a URL like https://your-bucket-name.s3.region.amazonaws.com/your-photo.jpg
- Test the security - Copy this URL and try opening it in a new browser tab
What happens? You should see an "Access Denied" error. This is exactly what we want! Your bucket is private, so even though the file exists, nobody can access it through the public internet.
Step 5: Organize your bucket structure
Good organization makes managing your website easier. Let's create a proper folder structure.
- Create a folder for images - In your bucket, click "Create folder"
- Name it "images" - Enter "images" as the folder name and click "Create folder"
- Move your photo - Select your uploaded photo (checkbox next to it), click "Actions" β "Move", then select the "images" folder and click "Move"
Why organize?
- Makes finding files easier as your site grows
- Follows web development best practices
- Helps with permissions and access control later
You'll know you're done when: Your photo is now located at images/your-photo.jpg inside your bucket.
Step 6: Understanding costs and your credit balance
Let's review how S3 pricing works and how it fits within your Free Tier credits.
S3 pricing for small websites:
- Storage: Approximately $0.023 per GB per month (US East region)*
- Requests: About $0.0004 per 1,000 GET requests, $0.005 per 1,000 PUT requests
- Data transfer: First 100 GB per month is always free
*Pricing varies by AWS region. For detailed and current pricing information, visit the S3 pricing pageΒ and use the AWS Pricing CalculatorΒ for accurate estimates based on your specific region and usage patterns.
Your Free Tier credits:
You receive $100 in credits when you create your account, with the opportunity to earn up to $100 more through activities. For small websites like the one you're building, S3 costs are typically minimal and well within most users' credit balance.
Monitoring your usage:
- Check your credit balance in the AWS Cost and Usage dashboard
- Your budget from Day 1 will alert you to any unexpected charges
- S3 usage appears in your billing details with clear cost breakdowns
Data transfer benefits:
The 100 GB of free data transfer out each month (always free, doesn't use credits) covers most small website traffic needs.
The 100 GB of free data transfer out each month (always free, doesn't use credits) covers most small website traffic needs.
Remember to monitor your usage as you learn, and adjust your project scope if needed to stay within your comfort zone for spending.
π Congratulations! You've successfully created secure cloud storage and uploaded your first file.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article