Practice Test

True or False: Amazon CloudWatch alarms can help you automatically initiate actions on your behalf.

• True

• False

Answer: True

Explanation: Amazon CloudWatch alarms allow you to automatically initiate actions, for example, to stop, start, or terminate an Amazon EC2 instance when a certain threshold is reached.

Which of the following are valid actions that CloudWatch alarms can trigger?

• a) Auto Scaling

• b) EC2 actions

• c) Notifying an Amazon SNS topic

• d) Ordering a coffee

Answer: a), b) and c)

Explanation: CloudWatch alarms can execute Auto Scaling policies, stop, start, or terminate EC2 instances, and notify an Amazon SNS topic. Ordering a coffee is beyond its capabilities.

Amazon CloudWatch allows you to create alarms based on _____.

• a) Metric data sent by AWS services

• b) Custom metrics for your applications or services

• c) Both a) and b)

• d) Neither a) nor b)

Answer: c) Both a) and b)

Explanation: You can create alarms based on metrics for AWS services and also custom metrics for your own applications.

True or False: An Amazon CloudWatch Alarm will trigger immediately when a defined threshold is breached.

• True

• False

Answer: False

Explanation: CloudWatch alarms do not operate on instantaneous metrics. They change their state after a defined threshold has been breached for a predefined number of evaluation periods.

Which setting in CloudWatch allows you to specify how many evaluation periods an alarm stays in a particular state before triggering an action?

• a) Threshold

• b) Data points

• c) Evaluation Periods

• d) Statistic

Answer: c) Evaluation Periods

Explanation: The number of evaluation periods set for an alarm allows you to determine how many periods an alarm stays in a particular state before triggering an action.

True or False: You can create a CloudWatch alarm in US East (N. Virginia) and use it to monitor resources in Asia Pacific (Mumbai).

• True

• False

Answer: False

Explanation: CloudWatch alarms are regional. Therefore, you cannot create an alarm in one region to monitor resources in another region.

CloudWatch alarms can be used to:

• a) Monitor a single metric over a time period.

• b) Compare the monitoring data points received during a specified period to a threshold.

• c) Set actions based on threshold conditions.

• d) All of the above.

Answer: d) All of the above

Explanation: CloudWatch alarms are used to monitor a single metric over a time period, compare monitoring data points received to a defined threshold, and trigger actions based on those conditions.

True or False: You cannot delete a CloudWatch alarm once it’s created.

• True

• False

Answer: False

Explanation: You can delete a CloudWatch alarm anytime from the AWS Management Console, AWS CLI or SDKs.

When you use Amazon SNS to respond to a CloudWatch alarm, it can send notifications via:

• a) Email

• b) SMS

• c) Mobile push

• d) All of the above

Answer: d) All of the above

Explanation: Amazon SNS can send CloudWatch alarm notifications through email, SMS messaging, or mobile push notifications.

True or False: You cannot modify an existing CloudWatch alarm.

• True

• False

Answer: False

Explanation: You can modify all attributes of an alarm after it’s created except the alarm name.

Interview Questions

What is AWS CloudWatch?

AWS CloudWatch is a monitoring and observability service built for DevOps engineers, developers, site reliability engineers (SREs), and IT managers. It provides actionable insights to monitor applications, understand and respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health.

What are CloudWatch alarms in AWS?

CloudWatch alarms are used in AWS to monitor a single metric over a specified time period, and perform one or more specified actions, based on the value of the metric relative to a given threshold.

How can you create a CloudWatch alarm in AWS?

You can create a CloudWatch alarm using the AWS Management Console, the AWS Command Line Interface, or an SDK. You only need to specify the metric to monitor, the threshold for the alarm, and the action to take when the threshold is breached.

What are the states of a CloudWatch alarm?

There are three states of a CloudWatch alarm: OK, ALARM, and INSUFFICIENT_DATA. The ‘OK’ states mean the metric is within the defined threshold, ‘ALARM’ means the metric is outside of the defined threshold, and ‘INSUFFICIENT_DATA’ means the alarm has just started, but the metric is not yet available, or there isn’t enough data for the metric to determine the alarm state.

What can AWS CloudWatch alarms be used for?

CloudWatch alarms can be used to automatically react to changes in your AWS resources. For example, you can set alarms that stop, terminate, reboot, or recover your EC2 instances, or scale an Auto Scaling group.

Can we delete a CloudWatch alarm?

Yes, you can delete a CloudWatch Alarm at any time via the AWS Management Console, CLI or SDK, once it is no longer needed.

Can I monitor custom metrics with CloudWatch?

Yes, besides the predefined metrics provided by AWS services, CloudWatch also allows you to monitor custom metrics generated by your own applications and services.

How does AWS CloudWatch handle alarm history?

AWS CloudWatch retains the history of an alarm’s state for 14 days, whether or not you delete the alarm.

What action can be performed when a CloudWatch Alarm state changes?

When a CloudWatch Alarm state changes, it can stop, terminate, reboot or recover an EC2 instance, send a notification, or trigger an Auto Scaling policy.

What happens when a CloudWatch alarm is in ‘INSUFFICIENT_DATA’ state?

If a CloudWatch alarm is in the ‘INSUFFICIENT_DATA’ state, it means the alarm has just started, the metric is not available, or there isn’t enough data for the metric to determine the alarm state.

How can you specify the period of time that a CloudWatch alarm evaluates a metric?

You can specify the period during the creation of the CloudWatch alarm. A period can be as short as one minute or as long as one day.

What happens when an alarm changes to any state and has no actions associated?

If an alarm changes to any state and it has no actions associated with that state, the alarm state will change but no actions will be executed.

Are CloudWatch alarms automatically enabled when they are created?

Yes, alarms are automatically enabled when they are created.

Can you modify the settings of a CloudWatch alarm once it’s created?

Yes, you can modify the settings of an alarm after it’s been created.

Can you retrieve statistics about the data points for an alarm?

Yes, you can retrieve the statistical data points for an alarm’s metric using the GetMetricStatistics API or from the CloudWatch console.

Leave a Reply

Your email address will not be published. Required fields are marked *