DEV Community

Oluwaseun Olaleye
Oluwaseun Olaleye

Posted on • Edited on

CREATING A STATIC WEBSITE WITH S3 BUCKET

USE CASE
In this scenario, you're a newly employed cloud engineer tasked with creating a website. This website must be available even during disasters and accessible anywhere with minimal load time, allowing users to access it quickly regardless of location. Additionally, you must minimize costs. Your goal is to create a simple website that meets these requirements. Let's proceed with planning how to accomplish this."

STEP 1
Creating an S3 Bucket
Begin by creating an S3 bucket, a scalable storage solution for data

To do this:

** Select a unique bucket name.**
** Choose an appropriate AWS region.**

Image description

Configure permissions to enable public access.

Image description

Image description

Confirm bucket creation.

We will create another S3 bucket in a separate region to ensure data redundancy and availability in case of disasters. By duplicating the process, we now have another S3 buckets in different regions, providing a disaster recovery solution. This is what we called cross-replication for disaster-recovery.

Image description

How Does Cross-Replication works?
The essence of the cross-replication is to duplicate files to other region ensuring availability. Firstly, select on the s3 bucket, click on files and upload the file.

Image description

Then, click on the bucket name and click on management. Kindly select create replication rule

Image description

Provide the bucket name, this is the second s3 bucket that we created, this will receive replicated files.

Image description

This time around, we will upload another file to the first bucket(heritageitbucket).

Image description

We can now see the same file in the second bucket(heritagedest).

Image description

Now that we've ensured availability, let's focus on cost-effectiveness.. How can we do that? There is a term called lifecycle management.

What is life cycle management?
Lifecycle management is a policy-driven approach that automates the transition of objects through different storage classes, reducing costs without compromising data availability.

How lifecycle management works:
We will create a lifecycle management rule. Click on the bucket(heritageitbucket)and click on management.

Image description

Let's name the lifecycle rule name and follow the screenshot below.

Image description

Like I said earlier, lifecycle automates the transition of objects through different storage classes. In this project, I automates my object from standard IA to Glacier instant retrieval and Glacier Deep Archive.

Standard IA: Infrequently accessed data once a month are stored here.
Glacier Instant Retrieval: Long-lived archived data accessed once a quarter are stored here. Minimum storage duration is 90 days.
Glacier Deep Archive: Long-lived archive data accessed once a year.

Image description

Now that we have discussed the preliminary, let us host our website.

We have already uploaded our *index.html * in the s3 bucket.

Image description

Top comments (0)