Creating Events in CloudWatch

Hands-On Lab

 

Photo of Derek Morgan

Derek Morgan

Training Architect

Length

00:45:00

Difficulty

Intermediate

In this activity, we create a backup event with CloudWatch. Amazon CloudWatch is a monitoring service for AWS cloud resources and the applications you run on AWS. You can use Amazon CloudWatch to collect and track metrics, collect and monitor log files, set alarms, and automatically react to changes in your AWS resources. Amazon CloudWatch can monitor AWS resources such as Amazon EC2 instances, Amazon DynamoDB tables, and Amazon RDS DB instances, as well as custom metrics generated by your applications and services, and any log files your applications generate. In the end, you will successfully create a cloudwatch event to monitor your environment.

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.

Creating Events in CloudWatch

Introduction

In this lab, we'll learn to use CloudWatch events to set up daily snapshots of a volume on an EC2 instance.

This written guide focuses on the steps necessary to complete the lab. It is recommended that you watch the accompanying video guide for extra details, clarifications, and insights.

Create an Event

To begin, log in to AWS and navigate to the EC2 console. We'll see that we have one running instance with two volumes. We'll be using CloudWatch to create snapshots of one of these volumes.

  • From the Services menu, select CloudWatch.
  • In the menu on the left side of the page, click Events.
  • Click Create rule.
  • Select the Schedule radio button at the top of the page.
  • Enter 1 in the text field marked Fixed rate of and select Days from the dropdown menu.
  • On the right side of the page, click the Add target button.
  • From the dropdown menu, select EC2 CreateSnapshot API call.
  • From the Volume ID menu, select the first option.
  • Click the Configure details button to continue.
  • In the name field, enter Snapshot, and in the description box, enter Daily Snapshot.
  • Below, in the permissions section, select the automation role from the dropdown menu (it should be the last option).
  • Click Create rule to continue.

We should now see a list of rules that includes the snapshot we've just created.

Conclusion

In this lab, we created a CloudWatch event that takes a snapshot of one of our EC2 volumes each day. For more information, we recommend following along with the video associated with this lab.