This example explains how to use OpenAPIs to create and configure overall scaling solutions, including timed, dynamic, custom, and fixed mode scaling solutions.
To create a complete Auto Scaling solution, follow the steps shown in the following diagram. The first three steps are used to create a simple scaling solution:
Create a scaling group. Configure the minimum (Min Size) and maximum (Max Size) number of ECS instances for scaling, and select the associated Server Load Balancer and RDS instances.
Create scaling configuration. Specify the ECS instances attributes for Auto Scaling, such as Image ID and Instance Type.
Enable the scaling group with the scaling configuration created in Step 2.
Create a scaling rule. For example, add n (number) ECS instances.
Create a scheduled task. For example, trigger the scaling rule created in Step 4 at 12:00 AM.
Create an alarm task (CloudMonitor API PutAlarmRule). For example, add 1 ECS instance when the CPU usages are greater than or equal to 80%.