deleteLoadBalancer method

Future<void> deleteLoadBalancer({
  1. required String loadBalancerArn,
})

Deletes the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. Deleting a load balancer also deletes its listeners.

You can't delete a load balancer if deletion protection is enabled. If the load balancer does not exist or has already been deleted, the call succeeds.

Deleting a load balancer does not affect its registered targets. For example, your EC2 instances continue to run and are still registered to their target groups. If you no longer need these EC2 instances, you can stop or terminate them.

May throw LoadBalancerNotFoundException. May throw OperationNotPermittedException. May throw ResourceInUseException.

Parameter loadBalancerArn : The Amazon Resource Name (ARN) of the load balancer.

Implementation

Future<void> deleteLoadBalancer({
  required String loadBalancerArn,
}) async {
  ArgumentError.checkNotNull(loadBalancerArn, 'loadBalancerArn');
  final $request = <String, dynamic>{};
  $request['LoadBalancerArn'] = loadBalancerArn;
  await _protocol.send(
    $request,
    action: 'DeleteLoadBalancer',
    version: '2015-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DeleteLoadBalancerInput'],
    shapes: shapes,
    resultWrapper: 'DeleteLoadBalancerResult',
  );
}