Preparations

Prepare the infrastructure

  • In this lab, we work in Region US West (Oregon) us-west-2. We prepare the lab resources by creating a CloudFormation stack from a template.
  • The template creates all resources: the simulated data center, private DNS zone, two source servers, and the recovery VPC used by DRS.
  • Download the CloudFormation template: drs-workshop-infra.yaml. If the browser opens the file instead of downloading it, right-click the link and select Save link as.
  1. Sign in to the AWS Management Console

    • Use an IAM user or role with administrator permissions.
    • In the Region selector at the top right, select US West (Oregon) us-west-2.

    AWS Elastic Disaster Recovery Workshop

  2. Open the CloudFormation console

    • In the search bar, type CloudFormation, then select CloudFormation. The CloudFormation Stacks page opens.
    • Select Create stack → With new resources (standard).

    AWS Elastic Disaster Recovery Workshop

  3. On the Create stack page

    • Under Prerequisite - Prepare template, select Choose an existing template (older console versions call it Template is ready).
    • Under Specify template, select Upload a template file.
    • Select Choose file and select the downloaded drs-workshop-infra.yaml.
    • Select Next.

    AWS Elastic Disaster Recovery Workshop

  4. On the Specify stack details page

    • For Stack name, enter EDRW.
    • Under Parameters, keep the default values in the table below. Do not change anything.
    Parameter Default Meaning
    LatestAmiId /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64 Latest Amazon Linux 2023 AMI using kernel 6.1. The kernel-default AMI now boots with kernel 6.18, while DRS supports Amazon Linux 2023 only up to kernel 6.12, so the replication agent cannot be installed on that AMI.
    InstanceType t3.small Instance type of the two source servers (t3.small or t3.medium).
    RootVolumeSize 10 Root EBS volume size of each source server, in GiB (10–30).
    • Select Next.

    AWS Elastic Disaster Recovery Workshop

  5. On the Configure stack options page

    • Select I acknowledge that AWS CloudFormation might create IAM resources with custom names. The template creates the instance profile drs-workshop-recovery-instance-profile with a fixed name.
    • Select Next.

    AWS Elastic Disaster Recovery Workshop

  6. On the Review and create page

    • Select Submit. The EDRW stack opens with the status CREATE_IN_PROGRESS.

    AWS Elastic Disaster Recovery Workshop

  7. After about 5–15 minutes, the EDRW stack changes to CREATE_COMPLETE

    • Open the Events tab and select refresh from time to time (a test run took about 5 minutes).
    • The two servers send a signal to CloudFormation only after WordPress and MariaDB are installed, so CREATE_COMPLETE means the applications are ready.

    AWS Elastic Disaster Recovery Workshop

  8. Open the Outputs tab of the stack

    • The stack has 11 outputs. You will use these values in later sections:
      • WebServerInstanceId, DbServerInstanceId: instance ID of the web server and database server
      • SourcePrivateSubnetId: Source Private subnet of the source VPC
      • DrsStagingSubnetId: DRS Staging subnet for DRS replication servers
      • TargetPrivateSubnetId: Target Private subnet for drill and recovery instances
      • TargetSecurityGroupId: TargetSecurityGroup security group for drill and recovery instances
      • RecoveryInstanceProfileName: drs-workshop-recovery-instance-profile instance profile for drill and recovery instances
      • WordPressPrivateUrl: http://wordpress-web.onpremsim.env/ (reachable only from inside the VPC)
      • WordPressDbSecretArn: ARN of the secret in Secrets Manager containing the WordPress database password
      • WebSessionCommand, DbSessionCommand: aws ssm start-session commands ready to use in AWS CloudShell
    • AWS Secrets Manager generates the WordPress database password (secret EDRW-wordpress-db), so the lab uses no fixed password. WordPress also gets its own random keys and salts when the web server starts. As a lab tradeoff, CloudFormation writes the resolved database password to the instance user data, and anyone who can read instance attributes can see it.

    AWS Elastic Disaster Recovery Workshop

  9. (Optional) Open the Resources tab of the stack

    • The tab lists the resources created by the stack:
    Resource Name Details
    Source VPC (simulated data center) onpremsim-source-vpc 10.0.0.0/16, internet gateway
    Source subnets Source Public, Source Private 10.0.0.0/24 (NAT gateway only), 10.0.1.0/24 (servers)
    Recovery VPC drs-recovery-vpc 10.0.0.0/16 (same CIDR as source VPC intentionally; the VPCs are not connected), internet gateway
    Recovery subnets DRS Staging, DR Public, Target Private 10.0.100.0/24 (replication server), 10.0.200.0/24 (NAT gateway only), 10.0.1.0/24 (drill instance)
    NAT gateways onpremsim-source-nat, drs-recovery-nat One NAT gateway per VPC, each with an Elastic IP
    Security groups (Name tag) onpremsim-web-sg, onpremsim-db-sg, TargetSecurityGroup HTTP 80 and MySQL 3306 only, no inbound management ports. The first two have generated group names such as EDRW-WebSecurityGroup-...
    EC2 instances wordpress-web.onpremsim.env, wordpress-db.onpremsim.env Amazon Linux 2023, 10.0.1.10 (Apache/PHP + WordPress) and 10.0.1.20 (MariaDB)
    Route 53 private hosted zone onpremsim.env Associated with both VPCs, A records wordpress-web and wordpress-db
    Secrets Manager secret EDRW-wordpress-db WordPress database password
    IAM role + instance profile source server role, drs-workshop-recovery-instance-profile Source servers: AmazonSSMManagedInstanceCore only. Drill instances: AmazonSSMManagedInstanceCore + AWSElasticDisasterRecoveryRecoveryInstancePolicy

    AWS Elastic Disaster Recovery Workshop