Auto Scaling can monitor instances and groups by

  • Health checks –
    • EC2 Auto Scaling periodically performs health checks on instances in Auto Scaling group
    • It identifies unhealthy instances
    • Auto Scaling finds health status using EC2 status checks, ELB health checks, or custom health checks.
  • CloudWatch metrics
    • EC2 Auto Scaling publishes data points to Amazon CloudWatch
    • CloudWatch retrieve statistics about those data points as ordered set of time series data or metrics.
    • use these metrics to verify that system is working as expected.
  • CloudWatch Events
    • EC2 Auto Scaling can also submit events to CloudWatch Events
    • Event submission is when
    • Auto Scaling groups launch or terminate instances,
    • lifecycle action occurs.
    • Can invoke Lambda function when event occurs.
  • SNS notifications
    • EC2 Auto Scaling can send Amazon SNS notifications
    • SNS sent, when groups launch or terminate instances.
  • CloudTrail logs
    • CloudTrail tracks calls to EC2 Auto Scaling API by
    • It stores information in log files in S3 bucket
    • Use log files to monitor activity of Auto Scaling groups.
    • Logs include
      • which requests were made,
      • source IP addresses of requests
      • who made request
      • when request was made

Instance Health Status

EC2 Auto Scaling finds health status of an instance using one or more of following:

  • Status checks by EC2 and includes both instance and system status checks.
    • Health checks provided by Elastic Load Balancing.
    • custom health checks.
  • Instance is considered unhealthy in any state other than running or if system status is impaired,
  • unhealthy instance is terminated and replacement is launched
  • Following states makes instance unhealthy
    • stopping
    • stopped
    • terminating
    • terminated

Auto Scaling Group Metrics

AWS/AutoScaling namespace includes following metrics.

Metric Description
GroupMinSize minimum size of Auto Scaling group.
GroupMaxSize maximum size of Auto Scaling group.
GroupDesiredCapacity number of instances that Auto Scaling group attempts to maintain.
GroupInServiceInstances number of instances that are running as part of Auto Scaling group. This metric does not include instances that are pending or terminating.
GroupPendingInstances number of instances that are pending. A pending instance is not yet in service. This metric does not include instances that are in service or terminating.
GroupStandbyInstances number of instances that are in a Standby state. Instances in this state are still running but are not actively in service.
GroupTerminatingInstances number of instances that are in process of terminating. This metric does not include instances that are in service or pending.
GroupTotalInstances total number of instances in Auto Scaling group. This metric identifies number of instances that are in service, pending, and terminating.

CloudWatch Events

  • It can automate AWS services and respond to system events as
    • application availability issues
    • resource changes
  • Events from AWS services are delivered to CloudWatch Events in real time.
  • Define rules to indicate actions to perform, against events
  • EC2 Auto Scaling can send events to CloudWatch Events for events
    • EC2 Instance-launch Lifecycle Action
    • EC2 Instance Launch Successful
    • EC2 Instance Launch Unsuccessful
    • EC2 Instance-terminate Lifecycle Action
    • EC2 Instance Terminate Successful
    • EC2 Instance Terminate Unsuccessful

SNS Notifications

EC2 Auto Scaling can send SNS notifications against following events

Event Description
autoscaling:EC2_INSTANCE_LAUNCH Successful instance launch
autoscaling:EC2_INSTANCE_LAUNCH_ERROR Failed instance launch
autoscaling:EC2_INSTANCE_TERMINATE Successful instance termination
autoscaling:EC2_INSTANCE_TERMINATE_ERROR Failed instance termination

message includes following information:

  • Event — event.
  • AccountId — AWS account ID.
  • AutoScalingGroupName — name of Auto Scaling group.
  • AutoScalingGroupARN — ARN of Auto Scaling group.
  • EC2InstanceId — ID of EC2 instance.
Menu