Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jayshin0511 committed Dec 4, 2019
1 parent 4fa89d8 commit 45f081f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
5 changes: 3 additions & 2 deletions 0_Prerequisities/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AWS Cloud9 - Cloud IDE

Login to AWS Console, go to *Ireland(eu-west-1) Region* and spin up a AWS Cloud9 environment. Please use Firefox or Chrome to open AWS Cloud9. If you don't have a VPC including **the default VPC**, you cannot deploy the Cloud9. Please create a default VPC first first before launching the Cloud9.
Login to AWS Console, go to *Ireland(eu-west-1)* region and spin up a AWS Cloud9 environment. Please use Firefox or Chrome to open AWS Cloud9. If you don't have a VPC including **the default VPC**, you cannot deploy the Cloud9. Please create a default VPC first first before launching the Cloud9.

<details><summary>Create a default VPC for Cloud9</summary>

Expand All @@ -10,7 +10,7 @@ Go to [VPC console in Ireland](https://eu-west-1.console.aws.amazon.com/vpc/home

</details>

https://eu-west-1.console.aws.amazon.com/cloud9/home?region=eu-west-1
If you have a VPC, go to [Cloud9](https://eu-west-1.console.aws.amazon.com/cloud9/home?region=eu-west-1 ) in Irelad.

![AWS Ireland](../images/00-c9-00.png)

Expand All @@ -24,6 +24,7 @@ AWS Cloud9 is free, you only pay for the underlying EC2 instance. Select your EC
![Create AWS Cloud9](../images/00-c9-03.png)

Click "Next Step", click "Create environment" and AWS Cloud9 will start! It would typically take 30-60s to create your AWS Cloud9 environment.

![Create AWS Cloud9](../images/00-c9-04.png)

## Clone the workshop project
Expand Down
26 changes: 18 additions & 8 deletions 1_PrimaryRegion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

In this module, you will deploy the Bookstore application and Wordpress blog in the primary (Ireland, eu-west-1) region using AWS CDK(Cloud Development Kit) and AWS CloudFormation. The solution uses the following components:

1. Fargate and Aurora - Book blog posts with Wordpress (AWS Fargate is a compute engine for Amazon ECS and EKS that allows you to run containers without having to manage servers or clusters)
2. CloudFront and S3 - Web static content, ReactJS files
3. API Gateway, AWS Lambda and Cognito - App layer with authentication
4. DynamoDB and ElastiCache - Books, Order, Cart tables and Best Seller information
1. Module 1-1.
* Fargate and Aurora - Book blog posts with Wordpress (AWS Fargate is a compute engine for Amazon ECS and EKS that allows you to run containers without having to manage servers or clusters)
2. Module 1-2.
* CloudFront and S3 - Web static content, ReactJS files
* API Gateway, AWS Lambda and Cognito - App layer with authentication
* DynamoDB and ElastiCache - Books, Order, Cart tables and Best Seller information

You will also create the IAM polices and roles required by these components.

Expand Down Expand Up @@ -44,22 +46,30 @@ Type "Y", and it will take around 5 min.

- You need `hostedZone.hostedZoneID` information in the module 2.

Now, let's check if the DNS is setup correctly in Route53. Open a new Terminal or iTerm and enter the following command to make sure you see that the DNS is resolving to the correct addresses.
Now, let's check if the DNS is setup correctly in Route53. Enter the following command to make sure you see that the DNS is resolving to the correct addresses.

```
dig +short NS <<YOUR HOSTED NAME URL>> e.g. myUniqueTeamName.multi-region.xyz
```
Now, compare the results with the ones in Route53. If they are the same, you can proceed to deploy the Wordpress. If not, please wait another 1 min before you seek help from the AWS instructors.
Now, compare the results with the ones in output of CDK. If they are the same, you can proceed to deploy the Wordpress with the following command.

![Compare Route53 namespace](../images/01-r53-01.png)
<!-- ![Compare Route53 namespace](../images/01-r53-01.png) -->

```
npx [email protected] deploy Wordpress-Primary
Do you wish to deploy these changes (y/n)?
```

Enter "**Y**", and it will take around 20 min.
Enter "**Y**", and it will take around 20 min.

FYI.





export MYSUBDOMAIN=<enter a 8 char unique subdomain name, eg: team1234>

**Your Book Blog is completed**

Expand Down
6 changes: 3 additions & 3 deletions 4_TestingFailover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ failure.
Since your DNS records are configured to use this health check, Route53 should
automatically use this information to point your application to the second region (Singapore).

You can validate this failover scenario when you visit `https://api-ir.<your subdomain>.multi-region.xyz/books` with `{"message":"Forbidden"}` error. However, you will get the book list when you visit `https://api.<your subdomain>.multi-region.xyz/books` as the Singapore region API is working properly (same as `https://api-sg.<your subdomain>.multi-region.xyz/books`.
You can validate this failover scenario when you visit `https://api-ir.<MYSUBDOMAIN>.multi-region.xyz/books` with `{"message":"Forbidden"}` error. However, you will get the book list when you visit `https://api.<MYSUBDOMAIN>.multi-region.xyz/books` as the Singapore region API is working properly (same as `https://api-sg.<MYSUBDOMAIN>.multi-region.xyz/books`.

The web application UI should also continue to
function and you should still be able to view and order books.

To confirm everything went as expected, go to your Bookstore application (`https://<your subdomain>.multi-region.xyz/books`)
To confirm everything went as expected, go to your Bookstore application (`https://MYSUBDOMAIN>.multi-region.xyz/books`)
and order a book again. You should see your application indicates Singapore region. (**Singapore flag icon at top left hand corner**). In Singapore's DynamoDB console, you will also see that the `Orders` table has a new record.

<details><summary>Troubleshooting Common Issues</summary>
It is possible that your Operating system AND browser are caching the old DNS entries, hence your failover will have problem (eg: `403 error` in your browser as you purchase books.).
To fix this:

* clear your dns entries in your OS, then verify how your OS is resolving your api endpoint, (eg: `host api.<your subdomain>.multi-region.xyz`). You can tell from the CNAME resolution which AWS region is being called.
* clear your dns entries in your OS, then verify how your OS is resolving your api endpoint, (eg: `host api.<MYSUBDOMAIN>.multi-region.xyz`). You can tell from the CNAME resolution which AWS region is being called.
* restart your browser or use another browser

</details>
Expand Down
2 changes: 1 addition & 1 deletion 5_Cleanup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The CloudFront origin access identity is still being used, hence, we need to del
Go to `CloudFront` and select your `CloudFront Distribution`. Go to `Origins and Origin Groups` and delete the `Origin Group` and `Orgin` that you created.

## 2. Delete API Gateway
Go to `Custom Domain Names` in `API Gateway` in `Singapore` and select your `*.<your subdomain>.multi-region.xyz` domain name. Click `x` button to delete it.
Go to `Custom Domain Names` in `API Gateway` in `Singapore` and select your `*.<MYSUBDOMAIN>.multi-region.xyz` domain name. Click `x` button to delete it.

## 3. Delete Aurora Read Replicas
You created the Aurora Read Replica in `Singapore` using CLI. Go to `RDS` console, select Read Replica Cluster `arc309-replica-cluster`, and select `Promote` in `Actions`. We need to promte the read replia as standalone to delete the instance. Then select Read Replica Instance `arc309-replica-instance` and select `Delete` in `Actions`. In the deletion window, uncheck `Create snapshot`, check `acknowledgement`, type `delete me`, and click `Delete`.
Expand Down

0 comments on commit 45f081f

Please sign in to comment.