autoscaling_terminate_instance_in_auto_scaling_group: Terminates the specified instance and optionally adjusts the...

Description Usage Arguments Value Request syntax Examples

View source: R/autoscaling_operations.R

Description

Terminates the specified instance and optionally adjusts the desired group size.

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 Rebalancing activities in the Amazon EC2 Auto Scaling User Guide.

Usage

1
2
autoscaling_terminate_instance_in_auto_scaling_group(InstanceId,
  ShouldDecrementDesiredCapacity)

Arguments

InstanceId

[required] The ID of the instance.

ShouldDecrementDesiredCapacity

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

Value

A list with the following syntax:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
list(
  Activity = list(
    ActivityId = "string",
    AutoScalingGroupName = "string",
    Description = "string",
    Cause = "string",
    StartTime = as.POSIXct(
      "2015-01-01"
    ),
    EndTime = as.POSIXct(
      "2015-01-01"
    ),
    StatusCode = "PendingSpotBidPlacement"|"WaitingForSpotInstanceRequestId"|"WaitingForSpotInstanceId"|"WaitingForInstanceId"|"PreInService"|"InProgress"|"WaitingForELBConnectionDraining"|"MidLifecycleAction"|"WaitingForInstanceWarmup"|"Successful"|"Failed"|"Cancelled",
    StatusMessage = "string",
    Progress = 123,
    Details = "string"
  )
)

Request syntax

1
2
3
4
svc$terminate_instance_in_auto_scaling_group(
  InstanceId = "string",
  ShouldDecrementDesiredCapacity = TRUE|FALSE
)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# This example terminates the specified instance from the specified Auto
# Scaling group without updating the size of the group. Auto Scaling
# launches a replacement instance after the specified instance terminates.
svc$terminate_instance_in_auto_scaling_group(
  InstanceId = "i-93633f9b",
  ShouldDecrementDesiredCapacity = FALSE
)

## End(Not run)

paws.management documentation built on March 8, 2021, 1:07 a.m.