Use EnableAvailabilityZonesForLoadBalancer with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use EnableAvailabilityZonesForLoadBalancer with a CLI

The following code examples show how to use EnableAvailabilityZonesForLoadBalancer.

CLI
AWS CLI

To enable Availability Zones for a load balancer

This example adds the specified Availability Zone to the specified load balancer.

Command:

aws elb enable-availability-zones-for-load-balancer --load-balancer-name my-load-balancer --availability-zones us-west-2b

Output:

{ "AvailabilityZones": [ "us-west-2a", "us-west-2b" ] }
PowerShell
Tools for PowerShell

Example 1: This example adds the specified Availability Zone to the specified load balancer. The output includes the complete list of Availability Zones.

Enable-ELBAvailabilityZoneForLoadBalancer -LoadBalancerName my-load-balancer -AvailabilityZone us-west-2a

Output:

us-west-2a us-west-2b