enterStandby method
Moves the specified instances into the standby state.
If you choose to decrement the desired capacity of the Auto Scaling group, the instances can enter standby as long as the desired capacity of the Auto Scaling group after the instances are placed into standby is equal to or greater than the minimum capacity of the group.
If you choose not to decrement the desired capacity of the Auto Scaling group, the Auto Scaling group launches new instances to replace the instances on standby.
For more information, see Temporarily removing instances from your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
May throw ResourceContentionFault.
Parameter autoScalingGroupName
:
The name of the Auto Scaling group.
Parameter shouldDecrementDesiredCapacity
:
Indicates whether to decrement the desired capacity of the Auto Scaling
group by the number of instances moved to Standby
mode.
Parameter instanceIds
:
The IDs of the instances. You can specify up to 20 instances.
Implementation
Future<EnterStandbyAnswer> enterStandby({
required String autoScalingGroupName,
required bool shouldDecrementDesiredCapacity,
List<String>? instanceIds,
}) async {
ArgumentError.checkNotNull(autoScalingGroupName, 'autoScalingGroupName');
_s.validateStringLength(
'autoScalingGroupName',
autoScalingGroupName,
1,
255,
isRequired: true,
);
ArgumentError.checkNotNull(
shouldDecrementDesiredCapacity, 'shouldDecrementDesiredCapacity');
final $request = <String, dynamic>{};
$request['AutoScalingGroupName'] = autoScalingGroupName;
$request['ShouldDecrementDesiredCapacity'] = shouldDecrementDesiredCapacity;
instanceIds?.also((arg) => $request['InstanceIds'] = arg);
final $result = await _protocol.send(
$request,
action: 'EnterStandby',
version: '2011-01-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['EnterStandbyQuery'],
shapes: shapes,
resultWrapper: 'EnterStandbyResult',
);
return EnterStandbyAnswer.fromXml($result);
}