ECS provides four provisioning methods to cover different scale and automation requirements. Use the table below to pick the right method for your scenario, then follow the linked guide.
Choose a provisioning method
| Method | Best for | Max instances | Supported billing | How to start |
|---|---|---|---|---|
| Manually create instances | One or more instances with the same configuration | Varies by creation method | Subscription, pay-as-you-go | Console or API |
| Deployment sets | Spreading instances across physical servers for high availability | Varies by deployment policy | Subscription, pay-as-you-go (no spot) | Console or API |
| Auto provisioning groups | Batch provisioning across instance types and zones, with cost optimization through spot instances | 1,000 per group | Pay-as-you-go, spot (no subscription) | Console or API |
| Auto Scaling | Automatically maintaining clusters that respond to traffic changes over time | 1,000 per scaling activity or scaling group | Pay-as-you-go, spot (auto-created); subscription (manually added) | Console or API |
Recommendation: For workloads that need ongoing lifecycle management, use Auto Scaling. For a one-time large batch with cost optimization through spot instances, use auto provisioning groups. For individual or same-configuration instances, create instances manually.
Manually create instances
Create one instance or a batch of instances that share the same configuration — instance type, zone, and billing method.
For the states an instance goes through during creation, see Instance lifecycle.
Use the ECS console
| Method | When to use |
|---|---|
| One-click purchase of a subscription instance | Purchase a subscription instance in minutes with minimal configuration. The simplest and fastest option. |
| Custom launch | Configure billing method, image, instance type, storage, bandwidth, and security group to match your requirements. |
| Launch from a custom or shared image | Start from a pre-built image that already has your preferred OS and application configuration, reducing setup time. |
| Launch from a community image | Quickly deploy an instance with a community-provided OS, applications, and data. |
| Purchase an instance with the same configuration | Replicate an existing instance's configuration exactly — useful for horizontal scaling. |
| Clone an instance | Create an identical or near-identical copy of a source instance. Useful for copying staging environments, disaster recovery, and migration. |
| Launch from a launch template | Create instances with one click using a saved template. Saves time when you repeatedly launch the same instance type. |
| Use the Auto Provisioning Group API to batch create instances | Create many pay-as-you-go instances in a single operation. |
Call API operations
| API operation | What it does |
|---|---|
| RunInstances | Creates up to 100 instances in a single call. See also Batch create ECS instances. |
| CreateInstance | Creates a single instance. |
Instances created with CreateInstance start in the Stopped state. Start them manually using StartInstance before use.
Use deployment sets
Spread instances across multiple physical servers so that a single hardware failure does not take down your entire workload.
Limitations:
Only pay-as-you-go and subscription instances are supported. Spot instances cannot be added to a deployment set.
Only specific instance types are supported. See Overview of deployment sets.
For quota and usage limits, see the Deployment set limits section of the Limits topic.
The number of instances per deployment set depends on the deployment policy. See Overview of deployment sets.
Use the ECS console
Alternatively, when launching instances through Custom launch, select an existing deployment set in the Deployment Set field under Advanced Settings, or click Manage Deployment Set to create a new one.
Call API operations
Call CreateDeploymentSet to create a deployment set.
Specify the deployment set ID when calling RunInstances or CreateInstance to create instances in that deployment set.
To move an existing instance to a different deployment set, call ModifyInstanceDeployment. For console instructions, see Change the deployment set for an instance.
Use auto provisioning groups
Provision a large batch of instances across multiple instance types and zones in one operation. Auto provisioning groups combine pay-as-you-go and spot instances to maximize compute capacity while minimizing cost.
Limitation: Only pay-as-you-go and spot instances are supported. Subscription instances are not supported.
Scale: Up to 1,000 instances per auto provisioning group.
ECS console: Create an auto provisioning group
API: Call CreateAutoProvisioningGroup, or follow the Batch create instances guide.
Use Auto Scaling
Auto Scaling automatically creates and releases instances in response to demand, keeping your cluster at the right size without manual intervention. It supports mixed billing methods and multi-zone, multi-instance-type deployments.
Limitations:
Only pay-as-you-go and spot instances can be automatically created in a scaling group.
Only subscription instances can be manually added to a scaling group.
Scale: Up to 1,000 instances per scaling activity and per scaling group. For quota details, see Limits.
Use the ECS console
Create a scaling group and configure it to automatically create or release instances. See Quickly scale ECS instances.
Call API operations
Call CreateScalingGroup to create a scaling group.
Call CreateScalingConfiguration to create an ECS-type scaling configuration.
Call EnableScalingGroup to enable the scaling group.
Call CreateScalingRule to define scale-out and scale-in rules.
(Optional) Call CreateAlarm to trigger scaling on metrics, or call CreateScheduledTask to trigger scaling on a schedule.
Use cases
Auto Scaling supports lifecycle hooks and automatic association with Server Load Balancer (SLB) instances and ApsaraDB RDS instances. Common use cases include:
Scalable web applications: Maintain stable capacity day-to-day and scale out automatically during traffic surges. See Build a scalable web application.
Cost optimization: Combine pay-as-you-go and spot instances to reduce costs during predictable business cycles. See Save your money with Auto Scaling.
High-availability compute clusters: Deploy across zones with spot instances for lower-cost redundancy. See Deploy a high-availability compute cluster.