Zend_Service_Amazon_Ec2-Securitygroups.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.amazon.ec2.securitygroups">
  4. <title>Zend_Service_Amazon_Ec2: Security Groups</title>
  5. <para>
  6. A security group is a named collection of access rules. These access
  7. rules specify which ingress (i.e., incoming) network traffic should
  8. be delivered to your instance. All other ingress traffic will be
  9. discarded.
  10. </para>
  11. <para>
  12. You can modify rules for a group at any time. The new rules are
  13. automatically enforced for all running instances and instances
  14. launched in the future.
  15. </para>
  16. <note>
  17. <title>Maximum Security Groups</title>
  18. <para>You can create up to 100 security groups.</para>
  19. </note>
  20. <sect2 id="zend.service.amazon.ec2.securitygroups.maintenance">
  21. <title>Security Group Maintenance</title>
  22. <example id="zend.service.amazon.ec2.securitygroups.maintenance.create">
  23. <title>Create a new Security Group</title>
  24. <para>
  25. <code>create</code> a new security group. Every instance is
  26. launched in a security group. If no security group is specified
  27. during launch, the instances are launched in the default security
  28. group. Instances within the same security group have unrestricted
  29. network access to each other. Instances will reject network access
  30. attempts from other instances in a different security group.
  31. </para>
  32. <para>
  33. <code>create</code> returns boolean <constant>TRUE</constant> or
  34. <constant>FALSE</constant>
  35. </para>
  36. <programlisting language="php"><![CDATA[
  37. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  38. 'aws_secret_key');
  39. $return = $ec2_sg->create('mygroup', 'my group description');
  40. ]]></programlisting>
  41. </example>
  42. <example id="zend.service.amazon.ec2.securitygroups.maintenance.describe">
  43. <title>Describe a Security Group</title>
  44. <para>
  45. <code>describe</code> returns information about security groups that
  46. you own.
  47. </para>
  48. <para>
  49. If you specify security group names, information about those security
  50. groups is returned. Otherwise, information for all security groups is
  51. returned. If you specify a group that does not exist, a fault is returned.
  52. </para>
  53. <para>
  54. <code>describe</code> will return an array containing information
  55. about security groups which includes the ownerId, groupName,
  56. groupDescription and an array containing all the rules for that security
  57. group.
  58. </para>
  59. <programlisting language="php"><![CDATA[
  60. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  61. 'aws_secret_key');
  62. $return = $ec2_sg->describe('mygroup');
  63. ]]></programlisting>
  64. </example>
  65. <example id="zend.service.amazon.ec2.securitygroups.maintenance.delete">
  66. <title>Delete a Security Group</title>
  67. <para>
  68. <code>delete</code> will remove the security group. If you attempt to
  69. delete a security group that contains instances, a fault is returned.
  70. If you attempt to delete a security group that is referenced by another
  71. security group, a fault is returned. For example, if security group B
  72. has a rule that allows access from security group A, security group A
  73. cannot be deleted until the allow rule is removed.
  74. </para>
  75. <para>
  76. <code>delete</code> returns boolean <constant>TRUE</constant> or
  77. <constant>FALSE</constant>.
  78. </para>
  79. <programlisting language="php"><![CDATA[
  80. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  81. 'aws_secret_key');
  82. $return = $ec2_sg->delete('mygroup');
  83. ]]></programlisting>
  84. </example>
  85. </sect2>
  86. <sect2 id="zend.service.amazon.ec2.securitygroups.authorize">
  87. <title>Authorizing Access</title>
  88. <example id="zend.service.amazon.ec2.securitygroups.authorize.ip">
  89. <title>Authorizing by IP</title>
  90. <para>
  91. <code>authorizeIp</code> Adds permissions to a security group based on
  92. an IP address, protocol type and port range.
  93. </para>
  94. <para>
  95. Permissions are specified by the IP protocol (TCP, UDP or ICMP), the
  96. source of the request (by IP range or an Amazon EC2 user-group pair),
  97. the source and destination port ranges (for <acronym>TCP</acronym> and UDP), and the
  98. ICMP codes and types (for ICMP). When authorizing ICMP, -1 can be used
  99. as a wildcard in the type and code fields.
  100. </para>
  101. <para>
  102. Permission changes are propagated to instances within the security group
  103. as quickly as possible. However, depending on the number of instances, a
  104. small delay might occur.
  105. </para>
  106. <para>
  107. <code>authorizeIp</code> returns boolean <constant>TRUE</constant> or
  108. <constant>FALSE</constant>
  109. </para>
  110. <programlisting language="php"><![CDATA[
  111. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  112. 'aws_secret_key');
  113. $return = $ec2_sg->authorizeIp('mygroup',
  114. 'protocol',
  115. 'fromPort',
  116. 'toPort',
  117. 'ipRange');
  118. ]]></programlisting>
  119. </example>
  120. <example id="zend.service.amazon.ec2.securitygroups.authorize.group">
  121. <title>Authorize By Group</title>
  122. <para>
  123. <code>authorizeGroup</code> Adds permissions to a security group.
  124. </para>
  125. <para>
  126. Permission changes are propagated to instances within the security group
  127. as quickly as possible. However, depending on the number of instances, a
  128. small delay might occur.
  129. </para>
  130. <para>
  131. <code>authorizeGroup</code> returns boolean <constant>TRUE</constant> or
  132. <constant>FALSE</constant>.
  133. </para>
  134. <programlisting language="php"><![CDATA[
  135. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  136. 'aws_secret_key');
  137. $return = $ec2_sg->authorizeGroup('mygroup', 'securityGroupName', 'ownerId');
  138. ]]></programlisting>
  139. </example>
  140. </sect2>
  141. <sect2 id="zend.service.amazon.ec2.securitygroups.revoke">
  142. <title>Revoking Access</title>
  143. <example id="zend.service.amazon.ec2.securitygroups.revoke.ip">
  144. <title>Revoke by IP</title>
  145. <para>
  146. <code>revokeIp</code> Revokes permissions to a security group based on
  147. an IP address, protocol type and port range. The permissions used to revoke
  148. must be specified using the same values used to grant the permissions.
  149. </para>
  150. <para>
  151. Permissions are specified by the IP protocol (TCP, UDP or ICMP), the
  152. source of the request (by IP range or an Amazon EC2 user-group pair),
  153. the source and destination port ranges (for <acronym>TCP</acronym> and UDP), and the
  154. ICMP codes and types (for ICMP). When authorizing ICMP, -1 can be used
  155. as a wildcard in the type and code fields.
  156. </para>
  157. <para>
  158. Permission changes are propagated to instances within the security group
  159. as quickly as possible. However, depending on the number of instances, a
  160. small delay might occur.
  161. </para>
  162. <para>
  163. <code>revokeIp</code> returns boolean <constant>TRUE</constant> or
  164. <constant>FALSE</constant>
  165. </para>
  166. <programlisting language="php"><![CDATA[
  167. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  168. 'aws_secret_key');
  169. $return = $ec2_sg->revokeIp('mygroup',
  170. 'protocol',
  171. 'fromPort',
  172. 'toPort',
  173. 'ipRange');
  174. ]]></programlisting>
  175. </example>
  176. <example id="zend.service.amazon.ec2.securitygroups.revoke.group">
  177. <title>Revoke By Group</title>
  178. <para>
  179. <code>revokeGroup</code> Adds permissions to a security group. The permissions
  180. to revoke must be specified using the same values used to grant the
  181. permissions.
  182. </para>
  183. <para>
  184. Permission changes are propagated to instances within the security group
  185. as quickly as possible. However, depending on the number of instances, a
  186. small delay might occur.
  187. </para>
  188. <para>
  189. <code>revokeGroup</code> returns boolean <constant>TRUE</constant> or
  190. <constant>FALSE</constant>.
  191. </para>
  192. <programlisting language="php"><![CDATA[
  193. $ec2_sg = new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
  194. 'aws_secret_key');
  195. $return = $ec2_sg->revokeGroup('mygroup', 'securityGroupName', 'ownerId');
  196. ]]></programlisting>
  197. </example>
  198. </sect2>
  199. </sect1>