Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can click “Customize cookies” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To continue without accepting these cookies, click “Continue without accepting.” To make more detailed choices or learn more, click “Customize cookies.”

Skip to content

/AWS1/CL_ASC=>TERMINATEINSTINAUTOSCGROUP()

About TerminateInstanceInAutoScalingGroup

Terminates the specified instance and optionally adjusts the desired group size. This operation cannot be called on instances in a warm pool.

This call simply makes a termination request. The instance is not terminated immediately. When an instance is terminated, the instance status changes to terminated. You can't connect to or start an instance after you've terminated it.

If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are terminated.

By default, Amazon EC2 Auto Scaling balances instances across all Availability Zones. If you decrement the desired capacity, your Auto Scaling group can become unbalanced between Availability Zones. Amazon EC2 Auto Scaling tries to rebalance the group, and rebalancing might terminate instances in other zones. For more information, see Manual scaling in the Amazon EC2 Auto Scaling User Guide.

Method Signature

IMPORTING

Required arguments:

IV_INSTANCEID TYPE /AWS1/ASCXMLSTRINGMAXLEN19 /AWS1/ASCXMLSTRINGMAXLEN19

The ID of the instance.

IV_SHOULDDECREMENTDESIREDCAP TYPE /AWS1/ASCSHOULDDECREMENTDESI00 /AWS1/ASCSHOULDDECREMENTDESI00

Indicates whether terminating the instance also decrements the size of the Auto Scaling group.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_ASCACTIVITYTYPE /AWS1/CL_ASCACTIVITYTYPE

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC