Create Lightsail bucket metric alarms - Amazon Lightsail

Create Lightsail bucket metric alarms

You can create an Amazon Lightsail alarm that watches a single bucket metric. An alarm can be configured to notify you based on the value of the metric relative to a threshold that you specify. Notifications can be a banner displayed in the Lightsail console, an email sent to your email address, and an SMS text message sent to your mobile phone number. For more information about alarms, see Alarms.

Contents

Bucket alarm limits

The following limits apply to alarms:

  • You can configure two alarms per metric.

  • Alarms are evaluated in 5 minute intervals, and each data point for alarms represents a 5 minute period of aggregated metric data.

  • You can only configure an alarm to notify you when the alarm state changes to OK if you configure the alarm to notify you by email and/or SMS text message.

  • You can only test the OK alarm notification if you configure the alarm to notify you by email and/or SMS text message.

  • You can only configure an alarm to notify you when the alarm state changes to INSUFFICIENT_DATA if you configure the alarm to notify you by email and/or SMS text message, and if you choose the Do not evaluate the missing data option for missing data points.

  • You can only test notifications if the alarm is in an OK state.

Best practices for configuring bucket alarms

Before you configure a metric alarm for your bucket, you should determine what you want to be notified about. For example, with the Bucket size metric in mind, you might want to be notified when your bucket is almost full. If your bucket current plan includes a 5 GB of storage space, then you might want to configure an alarm for the Bucket size metric when it reaches 4.5 GB. Then you should be notified with sufficient time to upsize your bucket's plan.

Default alarm settings

Default alarm settings are pre-populated when you add a new alarm in the Lightsail console. That is the recommended alarm configuration for the metric you selected. However, you should confirm that the default alarm configuration is appropriate for your resource. For example, the default alarm threshold for the bucket size bytes metric is greater than or equal to 75 GB. However, that request threshold might be too high for your bucket if it's configured to have only 5 GB of storage space. You might want to modify the alarm threshold to be equal to or greater than 4.5 GB.

Create bucket metric alarms using the Lightsail console

Complete the following steps to create a bucket metric alarm using the Lightsail console.

  1. Sign in to the Lightsail console.

  2. On the Lightsail home page, choose the Storage tab.

  3. Choose the name of the bucket for which you want to create alarms.

  4. Choose the Metrics tab on the bucket management page.

  5. Choose the metric for which you want to create an alarm in the drop-down menu under the Metrics Graphs heading. For more information, see Resource metrics.

  6. Choose Add alarm in the Alarms section of the page.

  7. Choose a comparison operator value in the drop-down menu. Example values are greater than or equal to, greater than, less than, or less than or equal to.

  8. Enter a threshold for the alarm.

  9. Enter the data points to alarm.

  10. Choose the evaluation periods. The period can be specified in 5-minute increments, from 5 minutes up to 24 hours.

  11. Choose one of the following notification methods:

    • Email — You are notified by email when the alarm state changes to ALARM.

    • SMS text message — You are notified by SMS text message when the alarm state changes to ALARM. SMS messaging is not supported in all AWS Regions, and SMS text messages cannot be sent to all countries/regions. For more information, see SMS text messaging support.

    Note

    You are required to add an email address or mobile phone number if you select to be notified by email or SMS but you haven’t yet configured a notification contact in the resource’s AWS Region. For more information, see Notifications.

  12. (Optional) Choose Send me a notification when the alarm state change to OK to be notified when the alarm state changes to OK. This option is available only if you choose to be notified by Email or SMS text message.

  13. (Optional) Choose Advanced settings, and then choose one of the following options:

    • Choose how the alarm should treat missing data The following options are available:

      • Assume it's not within the threshold (Breaching threshold) — Missing data points are treated as "bad" and breaching the threshold.

      • Assume it's within the threshold (Not breaching threshold) — Missing data points are treated as "good" and within the threshold.

      • Use the value of the last good data point (Ignore and maintain the current alarm state) — The current alarm state is maintained.

      • Do not evaluate it (Treat missing data as missing) — The alarm doesn't consider missing data points when evaluating whether to change state.

    • Choose Send a notification if there is insufficient data to be notified when the alarm state changes to INSUFFICIENT_DATA. This option is available only if you choose to be notified by Email or SMS text message.

  14. Choose Create to add the alarm.

    To edit the alarm later, choose the ellipsis icon (⋮) next to the alarm you want to edit, and choose Edit alarm.

Test bucket metric alarms using the Lightsail console

Complete the following steps to test an alarm using the Lightsail console. You might want to test an alarm to confirm that the configured notification options are working, such as to ensure that you receive an email or an SMS text message when the alarm is triggered.

  1. Sign in to the Lightsail console.

  2. On the Lightsail home page, choose the Storage tab.

  3. Choose the name of the bucket for which you want to test an alarm.

  4. Choose the Metrics tab on the bucket management page.

  5. Choose the metric for which you want to test an alarm in the drop-down menu under the Metrics Graphs heading.

  6. Scroll down to the Alarms section of the page, and choose the ellipsis icon (⋮) next to the alarm you want to test.

  7. Choose one of the following options:

    • Test alarm notification — Choose this option to test the notifications for when the alarm state changes to ALARM.

    • Test OK notification — Choose this option to test the notifications for when the alarm state changes to OK.

    Note

    If either of these options is unavailable, you might not have configured the notification options for the alarm, or the alarm might currently be in an ALARM state. For more information, see Bucket alarm limits.

    The alarm momentarily changes to an ALARM or OK state depending on the test option you chose, and an email and/or SMS text message is sent depending on what you configured as the notification method for the alarm. A notification banner displays in the Lightsail console only if you chose to test the ALARM notification. A notification banner is not displayed if you chose to test the OK notification. The alarm will return to its actual state often after a few seconds.

Next steps after creating bucket alarms

There are a few additional tasks that you can perform for your bucket alarms:

  • To stop receiving notifications, you can remove your email and mobile phone from Lightsail. For more information, see Delete notification contacts. You can also disable or delete an alarm to stop receiving notifications for a specific alarm. For more information, see Delete or disable metric alarms.