Cloud Resume Challenge
Published: 2022-12-12 23:53:08

**Introduction**
Hello everyone, in this blog post I will be sharing to everyone how I completed my Cloud Resume challenge on AWS! I Hope you guys enjoy it. 

**Get a website!**
To begin, I registered the domain victorhsiao.com on NameCheap and pointed it to AWS' nameservers. This allowed me to create a hosted zone in AWS Route 53 for the domain, which enabled the domain to resolve to my cloud resume once it was set up. With the domain properly configured, I was able to move on to configuring my website.

**S3 Bucket**
To host my website, I first created an S3 Bucket and enabled website hosting on it. I also created a public policy that allowed all public access to the bucket, since the website was intended to be accessed on the public internet. I set the homepage of the bucket to be index.html. After that, I had to configure the domain name to point to the S3 bucket, which required several steps. First, I had to enable website hosting on the bucket and create a public policy that allowed all public access. Then, I set the homepage of the bucket to be index.html.

**CNAME Records**
After the original victorhsiao.com bucket could be accessed over the internet using the HTTP protocol, I had to make sure that users could access it using the www subdomain. To do this, I went back into Route 53 and added CNAME records to the hosted zone for the domain. This allowed users to access the S3 bucket using either victorhsiao.com or www.victorhsiao.com. Adding the CNAME records was simple and just required going into the hosted zone and creating a new record.

**Certificates for security**
HTTP protocol does not encrypt data when it is transferred over the internet. To secure the traffic, I needed to enable HTTPS. To do this, I obtained an SSL certificate from AWS' Certificate Manager. The certificate tests whether I have access to the DNS information and whether I have control over it. If the test passes, the certificate is issued to me. I added my alternate domain name www.victorhsiao.com to the certificate. Once I had the certificate, I had to configure my sites to use HTTPS as well

**Content Delivery Networks**
To improve the user experience, many cloud infrastructures use Content Delivery Networks (CDNs) to cache content. I wanted to use CloudFront, AWS' CDN, for my static S3 website, so the first step was to configure my S3 buckets to use HTTPS as well as HTTP. This also meant that my alternate buckets that were supposed to redirect to my original domain needed to redirect over HTTPS instead of just HTTP. After this was done, I had to create a CloudFront distribution for the group of domains and associate it with the certificates that I had previously obtained.

**Cloudfront**
To create the CloudFront distribution, I had to add several CNAME records for the distribution's domain names. I had to create a separate distribution for each alternate domain, which added several records to AWS Route 53. When I accessed the CloudFront distribution URLs, it directed me to my victorhsiao.com site using the HTTPS protocol. The final step was to edit my Route 53 A records to point to my CloudFront distribution's domain names. After completing this, my bucket was able to use AWS CloudFront as its CDN.

**Traffic Metric**
To make the visitor counter work, I needed three things: 
- a database to store the count 
- a function to update the database when the visitor count increases
- API to interact with the function. 

AWS provided solutions to all 3: 
- DynamoDB
- AWS Lambda
- AWS API Gateway

I used DynamoDB to store a key-value pair with an updated record of the total count, and AWS Lambda was coded in Python to simply increment the count in the database by 1 each time the site was opened. To allow the website to execute the Lambda function, I created an API endpoint on AWS that was attached to my Lambda function. Every time this endpoint was accessed, the Lambda function would update the count. After all of this was working, I just had to add the HTML code to the website to display the count on my resume page.

**Conclusion**
After completing this challenge, I can most definitely say I’ve learned a lot more on the topic of cloud computing. One thing that fascinated me is that AWS has the ability to provide users with access to services without the users having to worry about building and maintaining an actual physical infrastructure, which is quite amazing. I definitely see cloud computing making a stronger footprint as technology progresses due to its services being super user-friendly while being powerful at the same time.