Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Latest commit

 

History

History
93 lines (56 loc) · 5 KB

README.md

File metadata and controls

93 lines (56 loc) · 5 KB

Learn Amazon Web Services

My journey following this Reddit post's walkthrough on how to become a Cloud Engineer

I deployed a "Fortune of The Day" web app using AWS and Terraform, architected in three different ways: traditional, microserviced and serverless.

During my journey, I used AWS Free Tier, so most of the costs (not all) of running these labs were on the house. I highly recommend you leverage Free Tier or keep close track of the costs of running this.

Table of Contents

Prerequisites

The architectures

In all architectures, the web app design looks like this:

All architectures...

Traditional

The traditional model serves both the static assets and the fortunes, on the same servers.

This model requires the administration of every piece of the app, from the OS to the application.

Microservices

The microserviced approach splits the static assets and the content in two, serving the static files from S3 and the content from our servers.

This model still requires server administration, but offloads our servers a great deal and keeps our application simpler. Instead of a full-blown web server we only have to write a RESTful API.

Serverless

This is the most interesting of all. Serverless splits static assets and content too, but now the content is served from AWS Lambda, which then talks to DynamoDB.

Serverless design removes all administration tasks and leaves it to the guys at Amazon Web Services.

Usage

  1. Add your domain to Route 53 (howto)
  2. Change to the desired architecture's directory (eg. cd serverless)
  3. Run terraform init
  4. Run terraform apply

Go to https://www.architecture.domain.com (replace architecture with traditional, microservices or serverless) and domain.com with your domain (eg. www.serverless.example.com)

Note: (Serverless only), AWS Lambda files must be world-readable, run chmod 644 src/api/*.py if Lambda throws Permission denied errors.

Destroy

  1. Run terraform destroy (inside the architecture's directory)

Once finished with the labs, I highly suggest you remove your domain name from Route 53 or else you will be charged every month (see Pricing) for a hosted zone.

Note: if destroying CloudFront distributions fails, run terraform destroy again, this is an issue with Terraform and/or CloudFront.

Further reading