1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.service.amazon.ec2.zones">
4 <title>Zend_Service_Amazon_Ec2: Regions and Availability Zones</title>
7 Amazon EC2 provides the ability to place instances in different regions
8 and Availability Zones. Regions are dispersed in separate geographic
9 areas or countries. Availability Zones are located within regions and
10 are engineered to be insulated from failures in other Availability Zones
11 and provide inexpensive low latency network connectivity to other
12 Availability Zones in the same region. By launching instances in separate
13 Availability Zones, you can protect your applications from the failure of
14 a single Availability Zone.
17 <sect2 id="zend.service.amazon.ec2.zones.regions">
18 <title>Amazon EC2 Regions</title>
21 Amazon EC2 provides multiple regions so you can launch Amazon EC2
22 instances in locations that meet your requirements. For example,
23 you might want to launch instances in Europe to be closer to your
24 European customers or to meet legal requirements.
28 Each Amazon EC2 region is designed to be completely isolated from
29 the other Amazon EC2 regions. This achieves the greatest possible
30 failure independence and stability, and it makes the locality of
31 each EC2 resource unambiguous.
34 <example id="zend.service.amazon.ec2.zones.regions.example">
35 <title>Viewing the available regions</title>
38 <code>describe</code> is used to find out which regions your account has access to.
42 <code>describe</code> will return an array containing information about which
43 regions are available. Each array will contain regionName and regionUrl.
46 <programlisting language="php"><![CDATA[
47 $ec2_region = new Zend_Service_Amazon_Ec2_Region('aws_key','aws_secret_key');
48 $regions = $ec2_region->describe();
50 foreach($regions as $region) {
51 print $region['regionName'] . ' -- ' . $region['regionUrl'] . '<br />';
57 <sect2 id="zend.service.amazon.ec2.zones.availability">
58 <title>Amazon EC2 Availability Zones</title>
61 When you launch an instance, you can optionally specify an Availability
62 Zone. If you do not specify an Availability Zone, Amazon EC2 selects one
63 for you in the region that you are using. When launching your initial
64 instances, we recommend accepting the default Availability Zone, which
65 allows Amazon EC2 to select the best Availability Zone for you based on
66 system health and available capacity. Even if you have other instances
67 running, you might consider not specifying an Availability Zone if your
68 new instances do not need to be close to, or separated from, your existing
72 <example id="zend.service.amazon.ec2.zones.availability.example">
73 <title>Viewing the available zones</title>
76 <code>describe</code> is used to find out which what the status is of each
81 <code>describe</code> will return an array containing information about which zones
82 are available. Each array will contain zoneName and zoneState.
85 <programlisting language="php"><![CDATA[
86 $ec2_zones = new Zend_Service_Amazon_Ec2_Availabilityzones('aws_key',
88 $zones = $ec2_zones->describe();
90 foreach($zones as $zone) {
91 print $zone['zoneName'] . ' -- ' . $zone['zoneState'] . '<br />';