There are more AWS SDK examples available in the AWS Doc SDK Examples
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-zonesus-west-2b
Output:
{ "AvailabilityZones": [ "us-west-2a", "us-west-2b" ] }
-
For API details, see EnableAvailabilityZonesForLoadBalancer
in AWS CLI Command Reference.
-
- 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
-
For API details, see EnableAvailabilityZonesForLoadBalancer in AWS Tools for PowerShell Cmdlet Reference.
-