DEV Community

Abdullateef OGUNDIPE
Abdullateef OGUNDIPE

Posted on

Day 3: Setting Up Your AWS Environment and Creating an S3 Bucket for Static Website Hosting

Recap of Day 2

Yesterday, we designed the architecture for migrating the LimitlessAO Power Solutions website to AWS. Using a combination of AWS services like S3, CloudFront, Route 53, and ACM, we outlined a robust solution for hosting a static website that’s secure, reliable, and scalable. Today, we’ll bring that design closer to reality by setting up the AWS environment. This includes creating an AWS account (if you don’t already have one), configuring IAM for secure access, and preparing S3 to host the website files.

Overview of the Services We’ll Use

  • Amazon S3 (Simple Storage Service): A storage service where we’ll host the static files of our website.
  • IAM (Identity and Access Management): Provides secure access control for users and services interacting with AWS resources.
  • CloudFront (Content Delivery Network): Although not implemented today, S3 setup ensures readiness for integration with CloudFront later. As we go through these steps, remember that AWS’s scalability means this environment can adapt to future dynamic needs.

Why Are We Creating an IAM User?

AWS security best practices recommend avoiding the use of the root account for day-to-day operations. The root account has unrestricted access to your AWS resources, and its misuse or compromise could have catastrophic consequences. By creating an IAM user, we limit permissions to only what’s necessary for specific tasks, thereby enhancing security. Once the IAM user is created, we’ll log in using this account to perform all subsequent operations.

Step-by-Step Implementation

Step 1: Create an AWS Account
If you don’t have an AWS account, follow these steps:

  • Visit the AWS Sign-Up Page.
  • Provide your details, including payment information (AWS offers a Free Tier for many services, but ensure you monitor usage to avoid charges).
  • Complete the verification and login process.
  • For more details, refer to the official AWS documentation: Creating an AWS Account.

Step 2: Configure IAM for Security (Not Compulsory)
Security is paramount when working with cloud services. We’ll create an IAM user with restricted permissions:

  • Navigate to the IAM Dashboard.
  • Create a new user:
  • Click on "Users" > "Add Users."
  • Assign a username (e.g., WebsiteAdmin).
  • Select AWS Management Console Access for GUI.
  • Attach policies:
  • Use the AmazonS3FullAccess policy for this user (we’ll restrict this later).
  • Download access credentials (store them securely). For further reading: Getting Started with IAM.

Once the IAM user is created, log out of the root account and log back in using the IAM user credentials via the AWS Management Console: AWS Console Login. This step ensures that we follow best security practices while creating and managing resources.

Step 3: Create an S3 Bucket for Static Website Hosting

Go to the S3 Management Console.

  • Click Create Bucket and follow these settings: Bucket Name: Use a unique name, e.g., limitlessao-website

Creating S3 bucket

  • Block Public Access: Keep this enabled for now; we’ll adjust it later for CloudFront

Block Public Access

  • Upload static website files: Use the Upload button to add HTML, CSS, JavaScript, and other assets.

FIles uploaded to s3

To learn more about S3: Hosting a Static Website on Amazon S3.

Step 4: Enable Static Website Hosting

  • Open your newly created bucket.
  • Go to Properties and enable Static Website Hosting:
  • Index Document: index.html
  • Save the configuration and note down the Endpoint URL. This URL is your website's address until we integrate CloudFront.

Enable static website hosting

"The foundation of any great system starts with careful setup, because a strong start paves the way for success."

What’s Next?

Tomorrow, we’ll integrate CloudFront into this setup to optimize content delivery globally, ensuring low latency and high performance. Additionally, we’ll configure an SSL certificate with ACM to enable secure HTTPS connections. Stay tuned!

LimitlessAO

Top comments (0)