PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Amazon EC2 Availability Zones

When you launch an instance, you can optionally specify an Availability Zone. If you do not specify an Availability Zone, Amazon EC2 selects one for you in the region that you are using. When launching your initial instances, we recommend accepting the default Availability Zone, which allows Amazon EC2 to select the best Availability Zone for you based on system health and available capacity. Even if you have other instances running, you might consider not specifying an Availability Zone if your new instances do not need to be close to, or separated from, your existing instances.

Example 761. Viewing the available zones

describe is used to find out which what the status is of each availability zone.

describe will return an array containing information about which zones are available. Each array will contain zoneName and zoneState.

<?php
$ec2_zones 
= new Zend_Service_Amazon_Ec2_Availabilityzones('aws_key',
                                                           
'aws_secret_key');
$zones $ec2_zones->describe();

foreach(
$zones as $zone) {
    print 
$zone['zoneName'] . ' -- ' $zone['zoneState'] . '<br />';
}

Zend Framework