I've configured an Amazon CloudWatch alarm to trigger my Amazon Elastic Compute Cloud (Amazon EC2) Auto Scaling policy. Why doesn't my Amazon EC2 Auto Scaling policy trigger when my CloudWatch alarm changes state?

When a CloudWatch alarm transitions to a new alarm state (OK, ALARM, or INSUFFICIENT_DATA), the alarm invokes any configured actions for that state. For Amazon EC2 Auto Scaling actions, the alarm continues to invoke the configured action for every period that the alarm remains in the new state.

Common reasons why a CloudWatch alarm state change doesn't trigger an Amazon EC2 Auto Scaling policy include:

  • The Auto Scaling action isn't enabled for the CloudWatch alarm, which prevents the scaling policy from being invoked.
  • The Auto Scaling group has conflicting simple scaling policies or step scaling policies, which prevent some of the policies from being triggered.
  • The Auto Scaling group has an incomplete lifecycle, which is preventing simple scaling policies from being applied. A lifecycle hook completes when it times out or when a CompleteLifecycleAction API or AWS Command Line Interface (AWS CLI) call is made.

Before you start, be sure that your CloudWatch alarm is transitioning to the ALARM state. If an alarm's configuration doesn't match the threshold of the metric that it's monitoring, the alarm might not transition to the ALARM state. If an alarm doesn't change states, it doesn't trigger Amazon EC2 Auto Scaling policies. For more information on how CloudWatch alarms are evaluated, see Evaluating an Alarm.

Verify that your CloudWatch alarm enters the ALARM state when expected by checking the alarm's Threshold value. Increase or decrease the Threshold to match your expected value. Also, review the Period and Evaluation Period of the alarm. You might need to edit your alarm Period and Evaluation Period to trigger your Amazon EC2 Auto Scaling policy as expected. For more information on how to be sure your alarm triggers actions, see How can I be sure that CloudWatch alarms trigger actions?.

Important: Be sure that you haven't suspended scaling processes (AlarmNotification, Launch, or Terminate) for your Amazon EC2 Auto Scaling group. Be sure to resume these scaling processes if they're suspended.

Check if Amazon EC2 Auto Scaling actions are enabled for the CloudWatch alarm

For a CloudWatch alarm to invoke an Amazon EC2 Auto Scaling policy, the ActionsEnabled parameter must be enabled in the alarm's configuration. Be sure the ActionsEnabled parameter is true in your alarm's configuration.

Note: If you create or update your alarm using the CloudWatch console, the ActionsEnabled parameter is set to true by default.

To check and enable alarm actions using the AWS CLI:

1.    Check your current configuration using describe-alarms as follows. Be sure to replace myalarm with your alarm's ID.

aws cloudwatch describe-alarms --alarm-names "myalarm" --query 'MetricAlarms[].ActionsEnabled'

2.    Review the output. If the ActionsEnabled parameter is not set to true, enable alarm actions using enable-alarm-actions as follows. Be sure to replace myalarm with your alarm's ID.

aws cloudwatch enable-alarm-actions --alarm-names myalarm

To check and enable alarm actions using the CloudWatch API:

1.    Check your current configuration using DescribeAlarms.

2.    If actions are not enabled for your alarm, enable actions using EnableAlarmActions.

Check the simple scaling and step scaling policies for your Amazon EC2 Auto Scaling group

To check your group's scaling policies using the Amazon EC2 console:

1.    Sign in to the Amazon EC2 console.

2.    In the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

3.    In the content pane, select your Auto Scaling group.

4.    Choose the Scaling Policies view.

5.    Note the Policy type (Step scaling or Simple scaling).

To check scaling policies using the AWS CLI, use the command describe-policies for the ID of your Auto Scaling group with the --policy-types parameter. The output lists the policies of each type (SimpleScaling or StepScaling).

To check scaling policies using an API, use the call DescribePolicies with the parameter PolicyTypes. The output lists the policies of each type (SimpleScaling or StepScaling).

If you have one simple scaling policy in effect, then any other simple scaling policies aren't invoked until the following conditions are met:

  • The simple scaling policy currently in effect has completed.
  • The cooldown period for the Amazon EC2 Auto Scaling policy has elapsed. A simple scaling policy honors the Amazon EC2 Auto Scaling policy's default or specified cooldown period.

Note: The execution of a simple scaling policy doesn't impact the execution of any step scaling policies. Be sure that contradictory policies aren't applied at the same time.

Check for Auto Scaling lifecycle hooks in your Amazon EC2 Auto Scaling policy

When an Auto Scaling lifecycle hook is in effect, simple scaling policies aren't executed. If you use a simple scaling policy in your Auto Scaling group, be sure to stop any lifecycle hooks.

Note: Step scaling policies still trigger if there is a lifecycle hook in progress.

Check that all lifecycle hooks are completed with a result of CONTINUE or ABANDON after their global timeout periods or heartbeat timeout periods expire.

To check for lifecycle hook actions using the Amazon EC2 console:

1.    Sign in to the Amazon EC2 console.

2.    In the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

3.    In the content pane, select your Auto Scaling group.

4.    Choose the Activity History view.

5.    Review the activity for any ongoing lifecycle hook actions.

6.    For steps to end a lifecycle hook, see Complete the Lifecycle Hook. To complete lifecycle hook actions using the AWS CLI, use the command complete-lifecycle-action. To complete lifecycle hook actions using an API, make a CompleteLifecycleAction call.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2018-12-26