Zend_Service_Amazon_Ec2-RegionsAndAvalibilityZones.xml 4.0 KB

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