6. Testing the solution

Due to the increase in latency, the CloudWatch Alarm created in previous steps will switch in Alarm state and trigger the Lambda function to switch traffic to Ohio region for smooth operation. Let’s verify this

  1. Select the Services dropdown at the very top of the AWS management console, and type CloudWatch. Select CloudWatch from the filtered results to navigate to the CloudWatch service console
  2. Select Alarms
  3. Select AnomalyAlarm created in Step 2, and Click on it
    • Observe the Alarm till it’s State switches to In alarm. (It may take about 3-5 minutes) Alarm_Red
  4. Once it goes to alarm state, Open CloudWatch console in Ohio region by navigating to the Region dropdown on top right of AWS console, and selecting US East (Ohio)
  5. Select Metrics
    • Under the All metrics tab, expand the Custom Namespaces section, and select the Website Metric
    • Select Region
    • Select us-east-2 to view the metric graph
  6. Select the Graphed Metrics tab
    • In the CanaryResponseTime row, under the Period column, set the value to 1 Second
  7. Observe how latency has decreased as we’re now serving traffic from the local region.

Final2 Final1