suspendProcesses method

Future<void> suspendProcesses({
  1. required String autoScalingGroupName,
  2. List<String>? scalingProcesses,
})

Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.

If you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly. For more information, see Suspending and resuming scaling processes in the Amazon EC2 Auto Scaling User Guide.

To resume processes that have been suspended, call the ResumeProcesses API.

May throw ResourceInUseFault. May throw ResourceContentionFault.

Parameter autoScalingGroupName : The name of the Auto Scaling group.

Parameter scalingProcesses : One or more of the following processes:

  • Launch
  • Terminate
  • AddToLoadBalancer
  • AlarmNotification
  • AZRebalance
  • HealthCheck
  • InstanceRefresh
  • ReplaceUnhealthy
  • ScheduledActions
If you omit this parameter, all processes are specified.

Implementation

Future<void> suspendProcesses({
  required String autoScalingGroupName,
  List<String>? scalingProcesses,
}) async {
  ArgumentError.checkNotNull(autoScalingGroupName, 'autoScalingGroupName');
  _s.validateStringLength(
    'autoScalingGroupName',
    autoScalingGroupName,
    1,
    255,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['AutoScalingGroupName'] = autoScalingGroupName;
  scalingProcesses?.also((arg) => $request['ScalingProcesses'] = arg);
  await _protocol.send(
    $request,
    action: 'SuspendProcesses',
    version: '2011-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ScalingProcessQuery'],
    shapes: shapes,
  );
}