cancelInstanceRefresh method

Future<CancelInstanceRefreshAnswer> cancelInstanceRefresh({
  1. required String autoScalingGroupName,
  2. bool? waitForTransitioningInstances,
})

Cancels an instance refresh or rollback that is in progress. If an instance refresh or rollback is not in progress, an ActiveInstanceRefreshNotFound error occurs.

This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes.

When you cancel an instance refresh, this does not roll back any changes that it made. Use the RollbackInstanceRefresh API to roll back instead.

May throw ActiveInstanceRefreshNotFoundFault. May throw LimitExceededFault. May throw ResourceContentionFault.

Parameter autoScalingGroupName : The name of the Auto Scaling group.

Parameter waitForTransitioningInstances : When cancelling an instance refresh, this indicates whether to wait for in-flight launches and terminations to complete. The default is true.

When set to false, Amazon EC2 Auto Scaling cancels the instance refresh without waiting for any pending launches or terminations to complete.

Implementation

Future<CancelInstanceRefreshAnswer> cancelInstanceRefresh({
  required String autoScalingGroupName,
  bool? waitForTransitioningInstances,
}) async {
  final $request = <String, String>{
    'AutoScalingGroupName': autoScalingGroupName,
    if (waitForTransitioningInstances != null)
      'WaitForTransitioningInstances':
          waitForTransitioningInstances.toString(),
  };
  final $result = await _protocol.send(
    $request,
    action: 'CancelInstanceRefresh',
    version: '2011-01-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CancelInstanceRefreshResult',
  );
  return CancelInstanceRefreshAnswer.fromXml($result);
}