Today I learned how to create an Amazon S3 bucket, upload files, host a portfolio website, and configure Amazon CloudFront.
1. Create an S3 Bucket
First, I logged in to the AWS Management Console and opened the Amazon S3 service.
Steps:
- Go to the AWS Console.
- Search for S3.
- Click Create bucket.
- Enter a unique bucket name.
Example:
nivi-22034-15
- Select the required AWS Region.
- Keep the remaining settings as required.
- Click Create bucket.
The S3 bucket was created successfully.
2. Upload the First Image
After creating the bucket, I uploaded an image to test S3 storage.
Steps:
- Open the S3 bucket.
- Click Upload.
- Click Add files.
- Select an image from the local computer.
- Click Upload.
- Verify that the image is available inside the bucket.
Example:
nivi-22034-15/
└── image.jpg
This helped me understand how files are stored as objects inside an S3 bucket.
3. Create and Upload the Portfolio index.html
After successfully uploading the image, I created a basic portfolio website using index.html.
The portfolio contains basic sections such as:
- About Me
- Skills
- Projects
- Contact
I then uploaded the index.html file to the S3 bucket.
The bucket structure became:
nivi-22034-15/
├── index.html
└── profile.jpg
4. Configure S3 for Static Website Hosting
Next, I configured the S3 bucket for static website hosting.
Steps:
- Open the S3 bucket.
- Go to the Properties tab.
- Find Static website hosting.
- Click Edit.
- Select Enable.
- Select Host a static website.
- Enter the following:
Index document: index.html
Error document: 404.html
- Click Save changes.
After saving the configuration, AWS provided an S3 website endpoint.
I opened the endpoint in the browser and verified that my portfolio was loading correctly.
5. Configure S3 Bucket Permissions
To access the website files, I configured the required S3 permissions.
I went to:
S3 → Bucket → Permissions
For the static website, I configured the bucket according to the required public-access settings.
I added the following bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::nivi-22034-15/*"
}
]
}
This policy allows users to read the objects stored inside the S3 bucket.
6. Test the Portfolio Website
After configuring S3, I opened the S3 website endpoint in a browser.
The index.html page loaded successfully, and I verified that the uploaded image was also displayed correctly.
The basic flow was:
Browser
↓
S3 Website Endpoint
↓
index.html
↓
Portfolio
7. Amazon CloudFront Configuration
After successfully hosting the portfolio on S3, I configured Amazon CloudFront.
CloudFront is a Content Delivery Network (CDN) provided by AWS. It helps deliver website content to users with lower latency and also supports HTTPS.
Steps:
- Open the AWS Management Console.
- Search for CloudFront.
- Open the CloudFront service.
- Click Create distribution.
- Select the S3 bucket as the origin.
- Select my S3 bucket:
nivi-22034-15
- Configure the required origin settings.
- Set the Default root object as:
index.html
- Configure the required CloudFront settings.
- Create the distribution.
CloudFront then generated a distribution domain name similar to:
https://xxxxxxxxxxxx.cloudfront.net
I opened the CloudFront URL in the browser and verified that my portfolio was loading successfully.
8. Final Setup
After completing the configuration, my portfolio was hosted using Amazon S3 and delivered through Amazon CloudFront.
The flow was:
User
↓
CloudFront
↓
S3 Bucket
↓
index.html
↓
Portfolio Website
9. What I Learned
In Day 1 – Session 1, I learned:
- How to create an S3 bucket.
- How to upload an image to S3.
- How to upload
index.html. - How to configure static website hosting.
- How to configure an S3 bucket policy.
- How to test a website using the S3 website endpoint.
- What Amazon CloudFront is.
- How to create a CloudFront distribution.
- How to connect an S3 bucket with CloudFront.
- How to set
index.htmlas the default root object. - How to access the portfolio through the CloudFront URL.
Overall, this session gave me hands-on experience with Amazon S3 and CloudFront for hosting and delivering a static portfolio website.



Top comments (0)