enableAvailabilityZonesForLoadBalancer method

Future<AddAvailabilityZonesOutput> enableAvailabilityZonesForLoadBalancer({
  1. required List<String> availabilityZones,
  2. required String loadBalancerName,
})

Adds the specified Availability Zones to the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.

For load balancers in a non-default VPC, use AttachLoadBalancerToSubnets.

The load balancer evenly distributes requests across all its registered Availability Zones that contain instances. For more information, see Add or Remove Availability Zones in the Classic Load Balancers Guide.

May throw AccessPointNotFoundException.

Parameter availabilityZones : The Availability Zones. These must be in the same region as the load balancer.

Parameter loadBalancerName : The name of the load balancer.

Implementation

Future<AddAvailabilityZonesOutput> enableAvailabilityZonesForLoadBalancer({
  required List<String> availabilityZones,
  required String loadBalancerName,
}) async {
  ArgumentError.checkNotNull(availabilityZones, 'availabilityZones');
  ArgumentError.checkNotNull(loadBalancerName, 'loadBalancerName');
  final $request = <String, dynamic>{};
  $request['AvailabilityZones'] = availabilityZones;
  $request['LoadBalancerName'] = loadBalancerName;
  final $result = await _protocol.send(
    $request,
    action: 'EnableAvailabilityZonesForLoadBalancer',
    version: '2012-06-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['AddAvailabilityZonesInput'],
    shapes: shapes,
    resultWrapper: 'EnableAvailabilityZonesForLoadBalancerResult',
  );
  return AddAvailabilityZonesOutput.fromXml($result);
}