as
  1. Help Center
  2. Service Overview
  3. Lifecycle

Lifecycle

The lifecycle of an instance in an AS group starts when it is created and ends when it is removed from the AS group.

Figure 1 shows the whole lifecycle of an instance in an AS group.
Figure 1 Instance lifecycle
In trigger conditions 2 and 4, a scaling action is automatically triggered to change the instance status.
Table 1 Instance status

Status

Sub-item

Status Description

Trigger Condition

Initial

None

The instance has not been added to an AS group.

The status of an instance is changed to Adding to AS group when either of the following operations is performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to expand resources.
  • You manually add instances to the AS group.

Adding to AS group

Add the instance.

When trigger condition 1 is met, AS adds the instance to expand the AS group capacity.

(Optional) Associate the instance with a load balancing listener.

When trigger condition 1 is met, AS associates the created instance with the load balancing listener.

Enabled

None

The instance is added to the AS group and starts to process service traffic.

The instance status is changed from Enabled to  Removing from AS group when any of the following operations are performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to reduce resources.
  • When a health check shows that an enabled instance is unhealthy, the instance is removed from the AS group.
  • You manually remove an instance from an AS group.

Removing from AS group

(Optional) Disassociate the instance from the load balancing listener.

When trigger condition 3 is met, the AS group disassociates the instance from the load balancing listener.

Remove the instance.

After the instance is unbound from the load balancing listener, it is removed from the AS group.

Removed

None

The instance lifecycle in the AS group ends.

N/A

Instances are added to an AS group manually or through a scaling action. Then, they go through the Adding to AS groupEnabled, and Removing from AS group statuses, and are finally removed from the AS group.

If you have not added a lifecycle hook to the AS group, the instance lifecycle changes as shown in Figure 1.

If you have added a lifecycle hook to the AS group, the hook suspends the instance status to waiting during a scaling action. The instance remains in the waiting status until the suspension times out or you call back the action. You can perform desired operations during the waiting. For example, you can install or configure software on a newly added instance or download log files from an instance before it is removed. For details, see section Managing Lifecycle Hooks. Figure 2 shows the whole lifecycle of an instance in an AS group.
Figure 2 Instance lifecycle
In trigger conditions 2, 4, 6, and 8, a scaling action is automatically triggered to change the instance status.
Table 2 Instance status

Status

Sub-status

Status Description

Trigger Description

Initial

None

The instance has not been added to an AS group.

The status of an instance is changed to Adding to AS group when either of the following operations is performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to expand resources.
  • You manually add instances to the AS group.

Adding to AS group

Add the instance.

When trigger condition 1 is met, AS adds the instance to expand the AS group capacity.

Wait (Adding to AS group)

None

The lifecycle hook suspends the instance that is being added to the AS group and sets the instance to be in waiting state.

The instance status is changed from Wait (Adding to AS group) to  Adding to AS group when either of the following operations is performed:
  • The default callback action is performed.
  • You manually perform the callback action.

For details, see section Managing Lifecycle Hooks.

Adding to AS group

(Optional) Associate the instance with a load balancing listener.

When trigger condition 3 is met, AS associates the instance with the load balancing listener.

Enabled

None

The instance is added to the AS group and starts to process service traffic.

The instance status is changed from Enabled to  Removing from AS group when any of the following operations are performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to reduce resources.
  • When a health check shows that an enabled instance is unhealthy, the instance is removed from the AS group.
  • You manually remove an instance from an AS group.

Removing from AS group

(Optional) Disassociate the instance from the load balancing listener.

When trigger condition 5 is met, the AS group disassociates the instance from the load balancing listener.

Wait (Removing from AS group)

None

The lifecycle hook suspends the instance that is being removed from the AS group and sets the instance to be in waiting state.

The instance status is changed from Wait (Removing from AS group) to  Removing from AS group when either of the following operations is performed:
  • The default callback action is performed.
  • You manually perform the callback action.

For details, see section Managing Lifecycle Hooks.

Removing from AS group

Remove the instance.

When trigger condition 7 is met, AS removes the instance from the AS group.

Removed

None

The instance lifecycle in the AS group ends.

N/A

Instances are added to an AS group manually or through a scaling action. Then, they go through the Adding to AS groupWait (Adding to AS group)Adding to AS groupEnabledRemoving from AS groupWait (Removing from the AS group), and Removing from AS group and are finally removed from the AS group.