4. Create the SSM Document

In this step, we will create a SSM document that on execution will introduce a spike in latency metric which eventually leads to execution of cross-region failover via the Lambda Code updated in the previous step

  1. Select the Services dropdown at the very top of the AWS management console, and type Systems Manager. Select Systems Manager from the filtered results to navigate to the Systems Manager service console
  2. Select Documents on left panel of the console
  3. Select Create command or session
    • Enter SSMLatencyDocument-Reinvent for Name
    • Scroll down to the Content section
    • Select YAML
    • Replace the contents currently in the YAML field with the following:
      schemaVersion: "2.2"
      description: "SSM RunCommand document for re:Invent ENT305 Workshop"
          default: "5"
          description: "Jitter added to base latency"
          type: String
          default: "20"
          description: "Base latency in milliseconds"
          type: String
          default: "25"
          description: "Probability of event happening"
          type: String
          name: CreateLatency
          action: "aws:runShellScript"
              - "sudo yum install iproute-tc -y"
              - "sudo tc qdisc add dev eth0 root netem delay {{latency}}ms {{jitter}}ms {{probability}}%"
  • Click Create document