Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tulna07 committed Mar 17, 2024
1 parent afac2c7 commit ab4d961
Show file tree
Hide file tree
Showing 23 changed files with 125 additions and 45 deletions.
6 changes: 3 additions & 3 deletions content/1-Introduction/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ AnimeHub currently allows lovers of anime to share their favorite Japanese-style

![AnimeHub share page](/images/1/0002.svg?featherlight=false&width=45pc)

The days of tedious on-premise resource maintenance and manual configuration of the AnimeHub backbone will be over thanks to AWS and Terraform, which allowed AinimeHub developers to concentrate on what really mattered — creating a memorable anime-sharing experience.
The days of tedious on-premise resource maintenance and manual configuration of the AnimeHub backbone will be over thanks to AWS and Terraform, which allow AinimeHub developers to concentrate on what really mattered — creating a memorable anime-sharing experience.

The next three pages provide a quick overview of Infrastructure as Code (IaC), Terraform, and notable features of Terraform (Terraform modules and Terraform Cloud workspaces), which are the main things we use in this workshop. You will mainly focus on creating nessessary Terraform modules manually and apply Terraform Cloud to helps teams use Terraform together.
The next three pages provide a quick overview of Infrastructure as Code (IaC), Terraform, and notable features of Terraform (Terraform modules and Terraform Cloud workspaces), which are the main things you use in this workshop. You will mainly focus on creating nessessary Terraform modules manually and apply Terraform Cloud to helps teams use Terraform together.

If you feel confident with those concepts, proceed to the [High-Level Design](../2-High-Level-Design/) section to explore AnimeHub's AWS architecture, Terraform modules, and Terraform Cloud workspaces in depth before engaging in hands-on work.
If you feel confident with those concepts, proceed to the [High-Level Design](../2-High-Level-Design/) section to explore the designs of AWS architecture, Terraform modules, and Terraform Cloud workspaces for AnimeHub in depth before engaging in hands-on work.

#### Content

Expand Down
20 changes: 10 additions & 10 deletions content/2-High-Level-Design/1-AWS-Architecture/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ A generic three-tier design of AnimeHub is shown in the following figure:

![Three-tier architecture](/images/2/1/0001.svg?featherlight=false&width=40pc)

Since the AnimeHub team includes talented full-stack developers, they prefer to work with a repository that contains both frontend and backend source code. Check out the [workshop-1-web-app]() repository to see their work. We will eventually deploy this source code to AWS infrastructure with GitHub Actions workflows to serve global users.
Since the AnimeHub team includes talented full-stack developers, they prefer to work with a repository that contains both frontend and backend source code. Check out the [workshop-1-web-app](https://github.com/Definitely-not-AWS-Workshops/workshop-1-web-app) repository to see their work. You will eventually deploy this source code to AWS infrastructure with GitHub Actions workflows to serve global users.

We next explore the requirements of the AnimeHub developers and recommend to them the appropriate AWS services for their global software.
You next explore the requirements of the AnimeHub developers and recommend to them the appropriate AWS services for their global software.

#### Web Tier

Since AnimeHub is a worldwide platform that anime fans use regularly to share and find their favorite series, we need to find a way to delivery its static contents faster and more efficient at client-side. Moreover, one of the main goals of the AnimeHub team is to focus on creating the client-side platform, which is built on ReactJS, rather than maintaining the server that hosts it. A combination of [AWS S3](https://docs.aws.amazon.com/s3/) and [AWS CloudFront](https://docs.aws.amazon.com/cloudfront/) might suite their needs.
Since AnimeHub is a worldwide platform that anime fans use regularly to share and find their favorite series, you need to find a way to delivery its static contents faster and more efficient at client-side. Moreover, one of the main goals of the AnimeHub team is to focus on creating the client-side platform, which is built on ReactJS, rather than maintaining the server that hosts it. A combination of [AWS S3](https://docs.aws.amazon.com/s3/) and [AWS CloudFront](https://docs.aws.amazon.com/cloudfront/) might suite their needs.

**AWS S3**

Expand All @@ -36,7 +36,7 @@ Allows you to serve static websites — such as single-page applications (ReactJ

![AWS CloudFront](/images/2/1/0003.svg?featherlight=false&height=100px&width=100px)

A managed content delivery network (CDN) that speeds up distribution of AnimeHub's contents from S3 bucket to users worldwide. Furthermore, to secure your connection to CloudFront when using alternative domain names, we utilize [AWS Certificate Manager](https://docs.aws.amazon.com/acm/) to provide support for provisioning, administering, and renewing publicly trusted TLS certificates.
A managed content delivery network (CDN) that speeds up distribution of AnimeHub's contents from S3 bucket to users worldwide. Furthermore, to secure your connection to CloudFront when using alternative domain names, you utilize [AWS Certificate Manager](https://docs.aws.amazon.com/acm/) to provide support for provisioning, administering, and renewing publicly trusted TLS certificates.

{{% notice tip %}}
Consider using [AWS WAF](https://docs.aws.amazon.com/waf/), a web application firewall, to protect your CloudFront distributions and origin servers from malicious attacks.
Expand All @@ -46,7 +46,7 @@ Consider using [AWS WAF](https://docs.aws.amazon.com/waf/), a web application fi

Developers on AnimeHub are passionate about [Docker](https://www.docker.com/) and containerized applications, and as you know, they are unwilling to deal with server management. Also, AnimeHub's server-side may handle massive workloads from anime fans around the world. They, therefore, can integrate [AWS Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html) and [AWS Auto Scaling](https://docs.aws.amazon.com/autoscaling/) with the [AWS ECS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) service.

Anime fans worldwide enjoy sharing their favorite anime with others. As a result, the platform's list of shared anime is constantly changing. Server-side caching and invalidation approaches for AnimeHub using AWS CloudFront would be challenging. Due to list caching, a fan may not see newly shared anime. As a result, we only use AWS CloudFront in front of the App tier, with the *CachingDisabled* policy, for any request to the */api* path.
Anime fans worldwide enjoy sharing their favorite anime with others. As a result, the platform's list of shared anime is constantly changing. Server-side caching and invalidation approaches for AnimeHub using AWS CloudFront would be challenging. Due to list caching, a fan may not see newly shared anime. As a result, you only use AWS CloudFront in front of the App tier, with the *CachingDisabled* policy, for any request to the */api* path.

**AWS ECS Fargate**

Expand All @@ -58,7 +58,7 @@ AWS ECS Fargate is a technology that may be used with Amazon ECS to run AnimeHu

![AWS Application Load Balancer](/images/2/1/0005.svg?featherlight=false&height=100px&width=100px)

AWS Application Load Balancer distributes incoming traffic among ECS Fargate tasks as targets in one or more Availability Zones. It monitors the health of its registered targets and directs traffic only to the healthy ones. It can automatically scale to handle the vast majority of workloads.
AWS Application Load Balancer distributes incoming traffic among ECS Fargate tasks as targets in one or more Availability Zones. It monitors the health of its registered targets and directs traffic only to the healthy ones.

**AWS Auto Scaling**

Expand All @@ -67,12 +67,12 @@ AWS Application Load Balancer distributes incoming traffic among ECS Fargate t
AWS Auto Scaling helps you ensure that you have the correct number of ECS Fargate tasks available to handle the load for your application. You create collections of ECS Fargate tasks that run server-side AnimeHub's containers, called Auto Scaling groups.

{{% notice tip %}}
APIs deal with sensitive data. Authentication and authorization mechanisms should be implemented to protect the API endpoints by ensuring that only approved users or apps are able to manipulate the data.
Currently, your RESTfull API endpoint is exposed to the Internet. APIs deal with sensitive data. Authentication and authorization mechanisms should be implemented to protect the API endpoints by ensuring that only approved users or apps are able to manipulate the data.
{{% /notice %}}

#### Database Tier

Though the AnimeHub team is quite familiar with traditional relational databases such as MySQL and PostgreSQL, they would like to try out a new cloud-native database technology that is scalable and easy to manage. We offer them [AWS DynamoDB](https://docs.aws.amazon.com/dynamodb/), a serverless non-relational database that is highly available across multiple Availability Zones in an AWS Region while reducing administration overhead.
Though the AnimeHub team is quite familiar with traditional relational databases such as MySQL and PostgreSQL, they would like to try out a new cloud-native database technology that is scalable, easy to use and manage. You offer them [AWS DynamoDB](https://docs.aws.amazon.com/dynamodb/), a serverless non-relational database that is highly available across multiple Availability Zones in an AWS Region while reducing administration overhead.

**AWS DynamoDB**

Expand All @@ -84,7 +84,7 @@ AWS DynamoDB allows the AnimeHub team to offload the administrative burdens of r

The key AWS services for each tier are combined with other services to provide a complete AWS-based infrastructure for the AnimeHub platform.
- While there may be encryption in transit between AWS services, AWS ECS Fargate would be placed in two private subnets of an [AWS VPC](https://docs.aws.amazon.com/vpc/) for high availability and would securely connect to other services via [AWS VPC Endpoints](https://docs.aws.amazon.com/whitepapers/latest/aws-privatelink/what-are-vpc-endpoints.html). As a result, the communication between these services is not exposed to the Internet.
- We also use an [AWS ECR](https://docs.aws.amazon.com/ecr/) with private repository settings to reliably store our container images.
- You also use an [AWS ECR](https://docs.aws.amazon.com/ecr/) with private repository settings to reliably store our container images.
- [AWS Identity and Access Management](https://docs.aws.amazon.com/iam/) might provide nessessary permissions for our access to the AWS environment.
- [AWS Route 53](https://docs.aws.amazon.com/route53/), a highly available and scalable Domain Name System (DNS) web service, that allows us to use our registered domain name for other AWS services.

Expand All @@ -94,6 +94,6 @@ After gathering and identifying requirements for the team and AnimeHub, the foll

![AWS architecture diagram](/images/2/1/0008.svg?featherlight=false&width=100pc)

Since AnimeHub developers work on [a repository]() that contains both frontend and backend source code, they would like to use two separate pipelines for deploying to the AWS infrastructure. For the sake of demonstration, we trigger both pipelines at the same time for deployment while tagging a version for our repository. The AWS architecture diagram with deployment pipelines for AnimeHub thus would be:
Since AnimeHub developers work on [a repository](https://github.com/Definitely-not-AWS-Workshops/workshop-1-web-app) that contains both frontend and backend source code, they would like to use two separate pipelines for deploying to the AWS infrastructure. For the sake of demonstration, you trigger both pipelines at the same time for deployment while tagging a version for our repository. The AWS architecture diagram with deployment pipelines for AnimeHub thus would be:

![AWS architecture diagram](/images/2/1/0009.svg?featherlight=false&width=100pc)
2 changes: 1 addition & 1 deletion content/2-High-Level-Design/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ chapter : false
pre : " <b> 2. </b> "
---

Before diving into the workshop, we will begin by understanding the essential AWS architecture, Terraform modules, Terraform Cloud workspaces for AnimeHub.
Before diving into the workshop, you will begin by understanding the essential AWS architecture, Terraform modules, Terraform Cloud workspaces for AnimeHub.

{{% notice note %}}
If you missed it, please read [Introduction](../1-Introduction/) to learn about how crucial it is of developing AnimeHub infrastructure with AWS and Terraform before progressing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ chapter : false
pre : " <b> 3.1 </b> "
---

We are going to initialize the *workshop-1-tf-modules* repository with the following folder structure:
You are going to initialize the *workshop-1-tf-modules* repository with the following folder structure:

```git
workshop-1-tf-modules/
Expand Down Expand Up @@ -36,7 +36,7 @@ workshop-1-tf-modules/
```

**1.** Go to your GitHub profile `github.com/<username>`. Remember to replace your GitHub username with *\<username\>*. Mine is [github.com/tulna07](https://github.com/tulna07), for example.
**1.** Go to your GitHub profile `github.com/<your-github-username>`. Mine is [github.com/tulna07](https://github.com/tulna07), for example.

**2.** Click the dropdown and select **New repository**.

Expand Down Expand Up @@ -94,7 +94,7 @@ git commit -m "first commit" && \
git push --set-upstream origin main
```

**11.** The GitHub repository after the first commit. We would later push Terraform module implementations from the local repository and remove *.gitkeep*.
**11.** The GitHub repository after the first commit. You would later push Terraform module implementations from the local repository and remove *.gitkeep*.

![0004](/images/3/1/0004.svg?featherlight=false&width=100pc)

Expand Down
6 changes: 3 additions & 3 deletions content/3-Preparation/2-Terraform-Live-Repository/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ chapter : false
pre : " <b> 3.2 </b> "
---

We are going to initialize the *workshop-1-tf-live* repository with the following folder structure:
You are going to initialize the *workshop-1-tf-live* repository with the following folder structure:

```git
workshop-1-tf-live/
Expand Down Expand Up @@ -37,7 +37,7 @@ workshop-1-tf-live/
├── (files and subfolders related to web module)
```

**1.** Go to your GitHub profile `github.com/<username>`. Remember to replace your GitHub username with *\<username\>*. Mine is [github.com/tulna07](https://github.com/tulna07), for example.
**1.** Go to your GitHub profile `github.com/<you-github-username>`. Mine is [github.com/tulna07](https://github.com/tulna07), for example.

**2.** Click the dropdown and select **New repository**.

Expand Down Expand Up @@ -95,7 +95,7 @@ git commit -m "first commit" && \
git push --set-upstream origin main
```

**11.** The GitHub repository after the first commit. We would later push Terraform module implementations from the local repository and remove *.gitkeep*.
**11.** The GitHub repository after the first commit. You would later push Terraform module implementations from the local repository and remove *.gitkeep*.

![0004](/images/3/2/0004.svg?featherlight=false&width=100pc)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title : "Terraform Cloud Workspaces"
title : "Terraform Cloud General Settings"
date : "`r Sys.Date()`"
weight : 4
chapter : false
pre : " <b> 3.4 </b> "
---

We now set up required Terraform Cloud workspaces for the *workshop-1-tf-live* repository.
In this section, you are going to set up the Terraform Cloud organization and project. You also add AWS credentials and VCS provider.

To continue with the instructions below, you will need a Terraform Cloud account. Sign in if you have one or create a new account at [app.terraform.io](https://app.terraform.io/).

Expand All @@ -18,7 +18,7 @@ To continue with the instructions below, you will need a Terraform Cloud account

![0001](/images/3/4/0001.svg?featherlight=false&width=100pc)

**3.** Choose **Organization name** that is unique. We will use this organization name later in Terraform module configuration. Then, click **Create organization**.
**3.** Choose **Organization name** that is unique. You will use this organization name later in Terraform module configuration. Then, click **Create organization**.

![0002](/images/3/4/0002.svg?featherlight=false&width=100pc)

Expand Down Expand Up @@ -66,34 +66,40 @@ A *variable set* allows you to create both input variables and environmental v

![00012](/images/3/4/00012.svg?featherlight=false&width=100pc)

**14.** Select **Environment variable**. Enter **AWS_ACCESS_KEY_ID** as key and the value in your access key id you obtain from .... Click **Sensitive** and then **Add variable**.
**14.** Select **Environment variable**. Enter **AWS_ACCESS_KEY_ID** as key, and the value is your access key id you obtained in [3.3 AWS Credentials](../3-AWS-Credentials/). Click **Sensitive**, then **Add variable**.

![00013](/images/3/4/00013.svg?featherlight=false&width=100pc)

**15.** Do the same for **AWS_SECRET_ACCESS_KEY** and we got two AWS credentials added. Click **Create variable set**.
**15.** Do the same for **AWS_SECRET_ACCESS_KEY** from step **13**. You then got AWS credentials added. Click **Create variable set**.

![00014](/images/3/4/00014.svg?featherlight=false&width=100pc)

**9.** Select the **New** dropdown and click **Workspace**.
**16.** After successfully creating the variable set, you are still in your organization's settings page. You next add the GitHub Version Control System (VCS) provider for our organization. Scroll down the left sidebar and click **Providers**.

![00015](/images/3/4/00015.svg?featherlight=false&width=100pc)

**10.** Select the **Select Project** dropdown and then choose the **workshop-1** project.
**17.** Click **Add a VCS provider**.

![00016](/images/3/4/00016.svg?featherlight=false&width=100pc)

**11.** Click **Create**.
**18.** Click the **GitHub** dropdown. Select **GitHub.com (Custom)**.

![00017](/images/3/4/00017.svg?featherlight=false&width=100pc)

**12.** Click **Version Control Workflow**.
**19.** Follow step 1 **On GitHub, register a new OAuth Application** to create the required information for the sequential steps.

![00018](/images/3/4/00018.svg?featherlight=false&width=100pc)

**13.** Select the **GitHub** dropdown and choose **GitHub.com (Custom)**.
**20.** Set the display name for VCS Provider **GitHub.com**. Enter the **Clien ID** and **Client Secrect** values you obtained from the previous step. Click **Connect and continue**.

![00019](/images/3/4/00019.svg?featherlight=false&width=100pc)

**21.** After successfully adding the GitHub VCS Provider, you skip **Advanced settings** page by scrolling down to the bottom and click **Skip and finish**.

![00020](/images/3/4/00020.svg?featherlight=false&width=100pc)






Expand Down
Loading

0 comments on commit ab4d961

Please sign in to comment.