Welcome
This is the Amazon EC2 Auto Scaling API Reference. Amazon EC2 Auto Scaling is designed to automatically launch and terminate EC2 instances based on user-defined scaling policies, scheduled actions, and health checks. This guide describes the Amazon EC2 Auto Scaling operations that you can call programmatically. For more information about Amazon EC2 Auto Scaling, see the Amazon EC2 Auto Scaling User Guide.
To configure Amazon EC2 instances that are launched by your Auto Scaling group, you can specify
a launch template or a launch configuration. Amazon EC2 Auto Scaling recommends that you use Amazon EC2
launch templates. Launch configurations are included as part of the same API as Auto Scaling
groups, but launch templates offer more features. For more information, see Amazon EC2 Auto Scaling will no longer add support for new EC2 features to Launch
Configurations
To get started, complete the following tasks:
-
Create a launch template using CreateLaunchTemplate.
-
Create an Auto Scaling group using CreateAutoScalingGroup.
To make programmatic API calls, you can also use one of the Amazon SDKs,
which consist of libraries and sample code for various programming languages and
platforms. The SDKs provide a convenient way to create programmatic access to Amazon EC2 Auto Scaling.
For example, the SDKs take care of cryptographically signing requests, managing errors,
and retrying requests automatically. For information about the Amazon SDKs, including how
to download and install them, see the Amazon
SDKs
API request rate
Amazon EC2 Auto Scaling uses the token bucket algorithm to implement API throttling. With
this algorithm, your account has a bucket that holds a specific number of tokens. The
number of tokens in the bucket represents your throttling limit at any given second.
Amazon EC2 Auto Scaling throttles API requests based on a shared API bucket. For example, calls to the
DescribeAutoScalingGroups and DescribeScheduledActions API operations use tokens from the same bucket.
Throttling means that Amazon EC2 Auto Scaling rejects a request because the request exceeds the
service's limit for the number of requests per second. When a request is throttled,
Amazon EC2 Auto Scaling returns a RateExceeded
error. For more information, see My Auto
Scaling API calls are getting throttled. What can I do to avoid this?
Additional information
-
For information about the permissions that are required to work with Amazon EC2 Auto Scaling resources programmatically, see Granting IAM users required permissions for Amazon EC2 Auto Scaling resources.
-
To specify a custom Amazon Machine Image (AMI) in your launch template, you must first create your AMI from a customized instance. For information on creating a custom AMI, see Create an AMI in the Amazon EC2 User Guide for Linux Instances.
-
To learn how to provide network connectivity for an Auto Scaling group created within a virtual private cloud (VPC), see Provide network connectivity for your Auto Scaling instances using Amazon VPC in the Amazon EC2 Auto Scaling User Guide.
-
For detailed information about the options you can configure in a launch template, see Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
This document was last published on August 8, 2022.