DEV Community

Cover image for How I Built My Personal Blog Site Using AWS Services
Lasantha Sanjeewa Silva for AWS Community Builders

Posted on • Updated on

How I Built My Personal Blog Site Using AWS Services

Recently, I build my personal blog site using AWS services. It's a central place to add my every contribution. Ex - Medium & Dev.to articles, Youtube videos, etc.

My Personal Blog Site : https://lasanthasilva.tech/

Basically, I used a .tech domain, static website hosting, and a lot of AWS services.

  • S3
  • CloudFront
  • Route53
  • Certificate Manager(ACM)
  • Lambda
  • APIGateway
  • DynamoDB
  • IAM

I'm completed AWS Cloud Resume Challenge. Link

This is my Architectural Diagram

aws-static-website-architectural-diagram

You can use my git repository to get sample code.
Git Repository

Let's start the challenge.

Step 1.
Build my blog site in HTML with CSS.

Step 2.
Created an S3 bucket to store portfolio files.

Step 3.
Create Route53 Hosted zone and add copy NS records. Next, paste the ns record domain provider nameservers section.

Step 4.
Next, go to the S3 bucket and enable Static website hosting, and map the Index document and Error document.

Step 5.
Requested a public certificate for your domain in AWS Certificate Manager(ACM).

Step 6.
Setup a CloudFront Distribution. Select S3 Static website hosting bucket endpoint and ACM public certificate.

Step 7.
Next, create a Lambda function for the Visitor Count display. Used Python 3.9 runtime.

Step 8.
Created DynamoDB table for Visitor count.

Step 9.
Created APIGateway REST API and Invoke Lambda function.

Step 10.
Create a git repository and push code.

Step 11.
Create GitHub Actions for deploying S3 static website files and Lambda function codes.

Finally, Push the latest release to Github.

These are the steps I used to build my personal blog site.

You can visit my blog site using this https://lasanthasilva.tech/.

Thanks for reading the Article.

References https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html

Connect With Me

LinkedIn

Twitter

Top comments (5)

Collapse
 
omkarokkadam profile image
OMKAR KADAM

@lasanthasilva a bug which I discovered is every new reload/refresh is appending the visitor count, This will show incorrect value, If you can use some cookie to determine visitor count, that would be perfect

Collapse
 
lasanthasilva profile image
Lasantha Sanjeewa Silva

@omkarokkadam I will check & update you. Thanks for your response.

Collapse
 
amzar profile image
Amzar

Cool post! Can you share the monthly cost for AWS services?

Collapse
 
lasanthasilva profile image
Lasantha Sanjeewa Silva

The cost of hosting a static website using Amazon S3, CloudFront, and Route 53 can vary depending on the amount of data transferred, the number of requests made, and the region you choose to host your resources. Here is an estimation of the costs for the Ohio region based on the current AWS pricing as of my knowledge cutoff:

  • Amazon S3
    Storage- $0.023 per GB per month for standard storage
    Data transfer out- $0.09 per GB for the first 10 TB
    Request- $0.0004 per 1,000 PUT, COPY, POST, or LIST requests; $0.000005 per 1,000 GET and all other requests

  • Amazon CloudFront
    Data transfer out- $0.085 per GB for the first 10 TB
    Request- $0.0075 per 10,000 HTTP or HTTPS requests

  • Amazon Route 53
    Hosted zone- $0.50 per hosted zone per month
    Queries- $0.40 per million queries for the first 1 billion queries

Note that these costs are estimated and may vary depending on your actual usage. You can use the AWS Pricing Calculator to get a more accurate estimate of your costs based on your specific needs.

Collapse
 
lasanthasilva profile image
Lasantha Sanjeewa Silva • Edited

Sure, I will share. After one month of using services.