Skip to main content

Applying Disaster Recovery Techniques in AWS

Hands-On Lab

 

Photo of Craig Arcuri

Craig Arcuri

AWS Training Architect II in Content

Length

01:00:00

Difficulty

Advanced

In this learning activity, the student will investigate different techniques in AWS for disaster recovery. The lesson will present AWS Disaster Recovery techniques and quantify the appropriate use cases, based RTO/RPO, for each technique. The student will then utilize a CloudFormation template to recover a large environment with many AWS Resources. This exercise will show that CloudFormation is a viable option for all but the most aggressive recovery timeline. A risk in using CloudFormation in Disaster Recovery is that hardcoded AMI IDs can change. The student will examine a CloudFormation template that has a Lambda function and can retrieve AMIs in real-time. The student will execute this template and verify that an EC2 instance was created.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Applying Disaster Recovery Techniques in AWS

Introduction

In this hands-on lab, we will use a CloudFormation template to tackle stack recreation and get a chance to dive further into disaster recovery techniques through AWS.

Solution

Log in to the AWS live environment using the cloud_user credentials provided. We must also ensure we are working in the us-east-1 (N. Virginia) region.

Download the amilookup.zip and AMILook.json files we'll need later, which are provided on the lab GitHub page.

Create a CloudFormation Stack

  1. Navigate to S3.
  2. Click to open the provided bucket.
  3. Click the checkbox next to either of the provided templates.
  4. Copy the Link URL in the box that appears once the template is selected, and paste it into a text file.
  5. Navigate to EC2 > Key Pairs.
  6. Click Create Key Pair.
  7. Give it a Key pair name of "drkeypair", and click Create.
  8. In a new browser tab, navigate to CloudFormation.
  9. Click Create stack.
  10. Ensure Template is ready is selected.
  11. With Amazon S3 URL selected, paste in the link you just copied into the Amazon S3 URL box.
  12. Click Next.
  13. On the stack details page, set the following values:
    • Stack name: drscenario
    • WebServerKeyName: drkeypair
  14. Click Next.
  15. On the stack options page, leave the settings as-is and click Next.
  16. On the review page, click Create stack.

Create a Cross-Stack Reference

Re-Create WordPress Stack Using a Template

  1. In a new browser tab, navigate to S3.
  2. Click Upload, and upload the amilookup.zip file you downloaded at the beginning of the lab.
  3. Back in the CloudFormation console, select the drscenario stack and click Delete.
  4. In the confirmation dialog box, click Yes, Delete. It will take a few minutes for it to be fully deleted.
  5. Click Create stack.
  6. In the Prerequisite - Prepare template section, select Create template in Designer.
  7. Click Create template in designer.
  8. Click the Template tab at the bottom.
  9. Copy everything in the CF_WordPress_Blog_Revised.json file from the lab GitHub page, and paste it into the Template window.
  10. Click the checkbox at the top to validate the template, and then click the cloud icon with the up arrow to create the stack.
  11. Click Next.
  12. On the stack details page, set the following values:
    • Stack name: DRStack
    • WebServerKeyName: drkeypair
  13. Click Next.
  14. On the stack options page, leave the settings as-is and click Next.
  15. On the review page, click Create stack. It will take a few minutes to finish being created.

Create Another Stack Using a Different Template

  1. Back in the S3 console, upload the AMILook.json file you downloaded at the beginning of the lab to our S3 bucket.
  2. Once it's uploaded, click to open it and copy its listed URL into a text file.
  3. Copy the bucket name and paste it into a text file as well, since we'll need that in a minute.
  4. Back in the CloudFormation console, click Create stack.
  5. With Amazon S3 URL selected, paste in the link you just copied into the Amazon S3 URL box.
  6. Click Next.
  7. On the stack details page, set the following values:
    • Stack name: amilookup
    • InstanceType: t2.micro
    • ModuleName: amilookup
    • S3Bucket: Paste in the bucket name you copied earlier
    • S3Key: amilookup.zip
  8. Click Next.
  9. On the stack options page, leave the settings as-is and click Next.
  10. On the review page, check the box stating I acknowledge that AWS CloudFormation might create IAM resources.
  11. Click Create stack. It will take a few minutes to be fully created.
  12. Optionally, verify further by navigating to EC2 > Instances. We should see the new instance that was created.
  13. If we click on the checkbox on the left-hand side next to our instance, we can view more details via the Description tab.

Conclusion

Congratulations on successfully completing this hands-on lab!