The AWS Academy Cloud Architecting - Capstone Project
Tags: aws, cloud
Published: 2023-04-04 12:22:50

The AWS Academy Cloud Architecting Capstone Project was all about designing and implementing a cloud-based solution using Amazon Web Services to solve a particular business problem. This included developing an architectural plan, deploying and configuring the required AWS services, and implementing the solution using industry best practices. 

Additionally, I made sure that this project related to cost optimisation, by selecting and making use of the most efficient computing resources when initialising processes, (as a budgeting precaution, of course), which could always be scaled up in case of business growth.

I followed a simple procedure in order to discover the issues and carry out the required tasks.

---

## Inspecting the architecture 

In this initial phase, I just wanted to have a look at the environment - what AWS had already provided us, as well as any guesses on what was missing from the scenario. These are some of the things I decided to do before starting:

- Inspect the VPC.
- Inspect the Subnets.
- Inspect the Security Groups.
- Inspect the Instances.

## The Cloud 9 IDE

Shortly after creating an AWS Cloud9 environment, I used the following command to get the ".zip" file which contains the PHP and image files for the website of the organisation which was then extracted.

`wget <link of the zip file>`

![wget](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n72wg8bglzmj2rnbig3c.png)**Figure 1**

## The LAMP web server stack on Linux

The following commands were used to install the LAMP stack:

`sudo yum -y update`
`sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2`

`sudo yum install -y httpd mariadb-server`
`sudo systemctl start httpd`

`sudo systemctl enable httpd`
`sudo systemctl is-enabled httpd`

This stack is essential for us to successfully deliver the website in a simple yet, stable way!

LAMP stands for Linux, Apache, MySQL, and PHP. Together, they provide a proven set of software for delivering high-performance web applications. Each component contributes essential capabilities to the stack.

After installing the stack, I simply:

- Opened port 80 from the security group of the Cloud9 EC2 
  instance
- Got the cloud9 EC2 public instance IP address and tested that I 
  could access the website

![Port80enable](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glgzjjpuvvem9tjlhq12.png)**Figure 2**

## Creating a MySQL RDS database instance

First of all, I crated an AWS RDS subnet group in the private subnets in zones us-east-1a and us-east-1b.

![Subnet Group](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xy9opx24c2sbnbhrxlu4.png)**Figure 3**

Then I proceeded to create an AWS RDS database with the following specifications: 

 -Databasetype: MySQL
 -Template: Dev/Test
 -DBinstanceidentifier: Example
 -DB instance size: db.t3.micro
 -Storage type: General Purpose (SSD)
 -Allocatedstorage: 20GiB
 -Storageautoscaling: Enabled
 -Standbyinstance: Enabled
 -Virtualprivatecloud: ExampleVPC
 -Databaseauthenticationmethod: Passwordauthentication
 -Initialdatabasename: exampledb
 -Enhancedmonitoring: Disabled

## Creating an Application Load Balancer

An Application Load Balancer is a requirement, so I created one using the following criteria: 

-Create target group
-Launch Web Instances in the private subnet

## Importing the data into the RDS database

Used the `wget <SQL dump file link>` command on Cloud9 to get the file with the sample data, connected and imported the data into the RDS database using:
`mysql -u admin -p --host <rds-endpoint>`
`mysql -u admin -p exampledb --host <rds-endpoint>  < Countrydatadump.sql`

## Parameters Store Configuration 

Added the following parameters to the Parameter Store and set the correct values:

**/example/endpoint**

**/example/username**

**/example/password**

**/example/database exampledb**

## Creating a Launch Template and an Autoscaling Group

The final steps of this project consisted of:
 
- Modifying the IAM role of the instance created by Cloud9 to 
  enable query on the website
- Created an Image of the instance (AMI)
- Modified Launch Template to use the recently created AMI
- Using the Launch Template with the correct AMI ID for the 
  Autoscaling Group creation

This allowed me to connect to the website by entering the Load Balancer's endpoint, it queried the data from the RDS database successfully too (Check out my design for this scenario which sums up the architecture).


![AWS Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2ln8u46dp7xqhcs2qzc.png)**Figure 4**

---

In conclusion, the AWS Academy Cloud Architecting 2.x - Capstone Project allowed me to develop the understanding of some concepts about creating a solution in a potentially real-life scenario. This project improved my overall confidence and knowledge about cloud environments, since in order to create a fully-functioning architecture there must be crucial factors to consider.

Lastly, I would recommend this project to everyone that is trying to commence their journey on the Cloud, because not only does this project challenge you to come up with solutions whenever there is an issue or whenever you are stuck, but it gives you some substantial hands-on experience and a taste of architecting a realistic case.