PageRenderTime 54ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/vendors/aws-sdk/services/ec2.class.php

https://github.com/joebeeson/amazon
PHP | 3813 lines | 1107 code | 300 blank | 2406 comment | 168 complexity | 32edd84b329ffa27a9dc688554fe2534 MD5 | raw file
Possible License(s): BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License").
  6. * You may not use this file except in compliance with the License.
  7. * A copy of the License is located at
  8. *
  9. * http://aws.amazon.com/apache2.0
  10. *
  11. * or in the "license" file accompanying this file. This file is distributed
  12. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied. See the License for the specific language governing
  14. * permissions and limitations under the License.
  15. */
  16. /**
  17. * File: AmazonEC2
  18. * Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity
  19. * in the cloud. It is designed to make web-scale computing easier for developers.
  20. *
  21. * Amazon EC2's simple web service interface allows you to obtain and configure capacity with minimal
  22. * friction. It provides you with complete control of your computing resources and lets you run on
  23. * Amazon's proven computing environment. Amazon EC2 reduces the time required to obtain and boot new
  24. * server instances to minutes, allowing you to quickly scale capacity, both up and down, as your
  25. * computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay
  26. * only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure
  27. * resilient applications and isolate themselves from common failure scenarios.
  28. *
  29. * Visit [http://aws.amazon.com/ec2/](http://aws.amazon.com/ec2/) for more information.
  30. *
  31. * Version:
  32. * Fri Dec 03 16:23:55 PST 2010
  33. *
  34. * License and Copyright:
  35. * See the included NOTICE.md file for complete information.
  36. *
  37. * See Also:
  38. * [Amazon Elastic Compute Cloud](http://aws.amazon.com/ec2/)
  39. * [Amazon Elastic Compute Cloud documentation](http://aws.amazon.com/documentation/ec2/)
  40. */
  41. /*%******************************************************************************************%*/
  42. // EXCEPTIONS
  43. /**
  44. * Exception: EC2_Exception
  45. * Default EC2 Exception.
  46. */
  47. class EC2_Exception extends Exception {}
  48. /*%******************************************************************************************%*/
  49. // MAIN CLASS
  50. /**
  51. * Class: AmazonEC2
  52. * Container for all service-related methods.
  53. */
  54. class AmazonEC2 extends CFRuntime
  55. {
  56. /*%******************************************************************************************%*/
  57. // CLASS CONSTANTS
  58. /**
  59. * Constant: DEFAULT_URL
  60. * Specify the default queue URL.
  61. */
  62. const DEFAULT_URL = 'ec2.amazonaws.com';
  63. /**
  64. * Constant: REGION_US_E1
  65. * Specify the queue URL for the US-East (Northern Virginia) Region.
  66. */
  67. const REGION_US_E1 = 'us-east-1';
  68. /**
  69. * Constant: REGION_US_W1
  70. * Specify the queue URL for the US-West (Northern California) Region.
  71. */
  72. const REGION_US_W1 = 'us-west-1';
  73. /**
  74. * Constant: REGION_EU_W1
  75. * Specify the queue URL for the EU (Ireland) Region.
  76. */
  77. const REGION_EU_W1 = 'eu-west-1';
  78. /**
  79. * Constant: REGION_APAC_SE1
  80. * Specify the queue URL for the Asia Pacific (Singapore) Region.
  81. */
  82. const REGION_APAC_SE1 = 'ap-southeast-1';
  83. /**
  84. * Constant: STATE_PENDING
  85. * The "pending" state code of an EC2 instance. Useful for conditionals.
  86. */
  87. const STATE_PENDING = 0;
  88. /**
  89. * Constant: STATE_RUNNING
  90. * The "running" state code of an EC2 instance. Useful for conditionals.
  91. */
  92. const STATE_RUNNING = 16;
  93. /**
  94. * Constant: STATE_SHUTTING_DOWN
  95. * The "shutting-down" state code of an EC2 instance. Useful for conditionals.
  96. */
  97. const STATE_SHUTTING_DOWN = 32;
  98. /**
  99. * Constant: STATE_TERMINATED
  100. * The "terminated" state code of an EC2 instance. Useful for conditionals.
  101. */
  102. const STATE_TERMINATED = 48;
  103. /**
  104. * Constant: STATE_STOPPING
  105. * The "stopping" state code of an EC2 instance. Useful for conditionals.
  106. */
  107. const STATE_STOPPING = 64;
  108. /**
  109. * Constant: STATE_STOPPED
  110. * The "stopped" state code of an EC2 instance. Useful for conditionals.
  111. */
  112. const STATE_STOPPED = 80;
  113. /*%******************************************************************************************%*/
  114. // SETTERS
  115. /**
  116. * Method: set_region()
  117. * This allows you to explicitly sets the region for the service to use.
  118. *
  119. * Access:
  120. * public
  121. *
  122. * Parameters:
  123. * $region - _string_ (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_EU_W1>, or <REGION_APAC_SE1>.
  124. *
  125. * Returns:
  126. * `$this`
  127. */
  128. public function set_region($region)
  129. {
  130. $this->set_hostname('http://ec2.'. $region .'.amazonaws.com');
  131. return $this;
  132. }
  133. /*%******************************************************************************************%*/
  134. // CONSTRUCTOR
  135. /**
  136. * Method: __construct()
  137. * Constructs a new instance of <AmazonEC2>.
  138. *
  139. * Access:
  140. * public
  141. *
  142. * Parameters:
  143. * $key - _string_ (Optional) Your Amazon API Key. If blank, it will look for the <AWS_KEY> constant.
  144. * $secret_key - _string_ (Optional) Your Amazon API Secret Key. If blank, it will look for the <AWS_SECRET_KEY> constant.
  145. *
  146. * Returns:
  147. * _boolean_ false if no valid values are set, otherwise true.
  148. */
  149. public function __construct($key = null, $secret_key = null)
  150. {
  151. $this->api_version = '2010-08-31';
  152. $this->hostname = self::DEFAULT_URL;
  153. if (!$key && !defined('AWS_KEY'))
  154. {
  155. throw new EC2_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
  156. }
  157. if (!$secret_key && !defined('AWS_SECRET_KEY'))
  158. {
  159. throw new EC2_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
  160. }
  161. return parent::__construct($key, $secret_key);
  162. }
  163. /*%******************************************************************************************%*/
  164. // SERVICE METHODS
  165. /**
  166. * Method: reboot_instances()
  167. * The RebootInstances operation requests a reboot of one or more instances. This operation is
  168. * asynchronous; it only queues a request to reboot the specified instance(s). The operation will
  169. * succeed if the instances are valid and belong to the user. Requests to reboot terminated instances
  170. * are ignored.
  171. *
  172. * Access:
  173. * public
  174. *
  175. * Parameters:
  176. * $instance_id - _string_|_array_ (Required) The list of instances to terminate. Pass a string for a single value, or an indexed array for multiple values.
  177. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  178. *
  179. * Keys for the $opt parameter:
  180. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  181. *
  182. * Returns:
  183. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  184. */
  185. public function reboot_instances($instance_id, $opt = null)
  186. {
  187. if (!$opt) $opt = array();
  188. // Required parameter
  189. $opt = array_merge($opt, CFComplexType::map(array(
  190. 'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
  191. )));
  192. return $this->authenticate('RebootInstances', $opt, $this->hostname);
  193. }
  194. /**
  195. * Method: describe_placement_groups()
  196. * Returns information about one or more PlacementGroup instances in a user's account.
  197. *
  198. * Access:
  199. * public
  200. *
  201. * Parameters:
  202. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  203. *
  204. * Keys for the $opt parameter:
  205. * GroupName - _string_|_array_ (Optional) The name of the `PlacementGroup`. Pass a string for a single value, or an indexed array for multiple values.
  206. * Filter - _ComplexList_ (Optional) A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Filter` subtype (documented next), or by passing an associative array with the following `Filter`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  207. * Filter.x.Name - _string_ (Optional) Specifies the name of the filter.
  208. * Filter.x.Value.y - _string_ (Optional) Contains one or more values for the filter.
  209. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  210. *
  211. * Returns:
  212. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  213. */
  214. public function describe_placement_groups($opt = null)
  215. {
  216. if (!$opt) $opt = array();
  217. // Optional parameter
  218. if (isset($opt['GroupName']))
  219. {
  220. $opt = array_merge($opt, CFComplexType::map(array(
  221. 'GroupName' => (is_array($opt['GroupName']) ? $opt['GroupName'] : array($opt['GroupName']))
  222. )));
  223. unset($opt['GroupName']);
  224. }
  225. // Optional parameter
  226. if (isset($opt['Filter']))
  227. {
  228. $opt = array_merge($opt, CFComplexType::map(array(
  229. 'Filter' => $opt['Filter']
  230. )));
  231. unset($opt['Filter']);
  232. }
  233. return $this->authenticate('DescribePlacementGroups', $opt, $this->hostname);
  234. }
  235. /**
  236. * Method: run_instances()
  237. * The RunInstances operation launches a specified number of instances.
  238. *
  239. * If Amazon EC2 cannot launch the minimum number AMIs you request, no instances launch. If there is
  240. * insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches as many
  241. * as possible to satisfy the requested maximum values.
  242. *
  243. * Every instance is launched in a security group. If you do not specify a security group at launch,
  244. * the instances start in your default security group. For more information on creating security
  245. * groups, see CreateSecurityGroup.
  246. *
  247. * An optional instance type can be specified. For information about instance types, see Instance
  248. * Types.
  249. *
  250. * You can provide an optional key pair ID for each image in the launch request (for more information,
  251. * see CreateKeyPair). All instances that are created from images that use this key pair will have
  252. * access to the associated public key at boot. You can use this key to provide secure access to an
  253. * instance of an image on a per-instance basis. Amazon EC2 public images use this feature to provide
  254. * secure access without passwords.
  255. *
  256. * Launching public images without a key pair ID will leave them inaccessible.
  257. *
  258. * The public key material is made available to the instance at boot time by placing it in the
  259. * openssh_id.pub file on a logical device that is exposed to the instance as /dev/sda2 (the ephemeral
  260. * store). The format of this file is suitable for use as an entry within ~/.ssh/authorized_keys (the
  261. * OpenSSH format). This can be done at boot (e.g., as part of rc.local) allowing for secure access
  262. * without passwords.
  263. *
  264. * Optional user data can be provided in the launch request. All instances that collectively comprise
  265. * the launch request have access to this data For more information, see Instance Metadata.
  266. *
  267. * If any of the AMIs have a product code attached for which the user has not subscribed, the
  268. * RunInstances call will fail.
  269. *
  270. * We strongly recommend using the 2.6.18 Xen stock kernel with the c1.medium and c1.xlarge instances.
  271. * Although the default Amazon EC2 kernels will work, the new kernels provide greater stability and
  272. * performance for these instance types. For more information about kernels, see Kernels, RAM Disks,
  273. * and Block Device Mappings.
  274. *
  275. * Access:
  276. * public
  277. *
  278. * Parameters:
  279. * $image_id - _string_ (Required) Unique ID of a machine image, returned by a call to DescribeImages.
  280. * $min_count - _integer_ (Required) Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.
  281. * $max_count - _integer_ (Required) Maximum number of instances to launch. If the value is more than Amazon EC2 can launch, the largest possible number above minCount will be launched instead. Between 1 and the maximum number allowed for your account (default: 20).
  282. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  283. *
  284. * Keys for the $opt parameter:
  285. * KeyName - _string_ (Optional) The name of the key pair.
  286. * SecurityGroup - _string_|_array_ (Optional) The names of the security groups into which the instances will be launched. Pass a string for a single value, or an indexed array for multiple values.
  287. * UserData - _string_ (Optional) Specifies additional information to make available to the instance(s).
  288. * InstanceType - _string_ (Optional) Specifies the instance type for the launched instances. [Allowed values: `t1.micro`, `m1.small`, `m1.large`, `m1.xlarge`, `m2.xlarge`, `m2.2xlarge`, `m2.4xlarge`, `c1.medium`, `c1.xlarge`, `cc1.4xlarge`, `cg1.4xlarge`]
  289. * Placement - _ComplexType_ (Optional) Specifies the placement constraints (Availability Zones) for launching the instances. A ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Placement` subtype (documented next), or by passing an associative array with the following `Placement`-prefixed entries as keys. See below for a list and a usage example.
  290. * Placement.AvailabilityZone - _string_ (Optional) The availability zone in which an Amazon EC2 instance runs.
  291. * Placement.GroupName - _string_ (Optional) The name of a PlacementGroup.
  292. * KernelId - _string_ (Optional) The ID of the kernel with which to launch the instance.
  293. * RamdiskId - _string_ (Optional) The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.
  294. * BlockDeviceMapping - _ComplexList_ (Optional) A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `BlockDeviceMapping` subtype (documented next), or by passing an associative array with the following `BlockDeviceMapping`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  295. * BlockDeviceMapping.x.VirtualName - _string_ (Optional) Specifies the virtual device name.
  296. * BlockDeviceMapping.x.DeviceName - _string_ (Optional) Specifies the device name (e.g., /dev/sdh).
  297. * BlockDeviceMapping.x.Ebs.SnapshotId - _string_ (Optional) The ID of the snapshot from which the volume will be created.
  298. * BlockDeviceMapping.x.Ebs.VolumeSize - _integer_ (Optional) The size of the volume, in gigabytes.
  299. * BlockDeviceMapping.x.Ebs.DeleteOnTermination - _boolean_ (Optional) Specifies whether the Amazon EBS volume is deleted on instance termination.
  300. * BlockDeviceMapping.x.NoDevice - _string_ (Optional) Specifies the device name to suppress during instance launch.
  301. * Monitoring.Enabled - _boolean_ (Optional) Enables monitoring for the instance.
  302. * SubnetId - _string_ (Optional) Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.
  303. * DisableApiTermination - _boolean_ (Optional) Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.
  304. * InstanceInitiatedShutdownBehavior - _string_ (Optional) Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.
  305. * License - _ComplexType_ (Optional) Specifies active licenses in use and attached to an Amazon EC2 instance. A ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `License` subtype (documented next), or by passing an associative array with the following `License`-prefixed entries as keys. See below for a list and a usage example.
  306. * License.Pool - _string_ (Optional) The license pool from which to take a license when starting Amazon EC2 instances in the associated `RunInstances` request.
  307. * PrivateIpAddress - _string_ (Optional) If you're using Amazon Virtual Private Cloud, you can optionally use this parameter to assign the instance a specific available IP address from the subnet.
  308. * ClientToken - _string_ (Optional) Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, go to How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.
  309. * AdditionalInfo - _string_ (Optional) For internal use only.
  310. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  311. *
  312. * Returns:
  313. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  314. */
  315. public function run_instances($image_id, $min_count, $max_count, $opt = null)
  316. {
  317. if (!$opt) $opt = array();
  318. $opt['ImageId'] = $image_id;
  319. $opt['MinCount'] = $min_count;
  320. $opt['MaxCount'] = $max_count;
  321. // Optional parameter
  322. if (isset($opt['SecurityGroup']))
  323. {
  324. $opt = array_merge($opt, CFComplexType::map(array(
  325. 'SecurityGroup' => (is_array($opt['SecurityGroup']) ? $opt['SecurityGroup'] : array($opt['SecurityGroup']))
  326. )));
  327. unset($opt['SecurityGroup']);
  328. }
  329. // Optional parameter
  330. if (isset($opt['Placement']))
  331. {
  332. $opt = array_merge($opt, CFComplexType::map(array(
  333. 'Placement' => $opt['Placement']
  334. )));
  335. unset($opt['Placement']);
  336. }
  337. // Optional parameter
  338. if (isset($opt['BlockDeviceMapping']))
  339. {
  340. $opt = array_merge($opt, CFComplexType::map(array(
  341. 'BlockDeviceMapping' => $opt['BlockDeviceMapping']
  342. )));
  343. unset($opt['BlockDeviceMapping']);
  344. }
  345. // Optional parameter
  346. if (isset($opt['License']))
  347. {
  348. $opt = array_merge($opt, CFComplexType::map(array(
  349. 'License' => $opt['License']
  350. )));
  351. unset($opt['License']);
  352. }
  353. return $this->authenticate('RunInstances', $opt, $this->hostname);
  354. }
  355. /**
  356. * Method: describe_reserved_instances()
  357. * The DescribeReservedInstances operation describes Reserved Instances that were purchased for use
  358. * with your account.
  359. *
  360. * Access:
  361. * public
  362. *
  363. * Parameters:
  364. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  365. *
  366. * Keys for the $opt parameter:
  367. * ReservedInstancesId - _string_|_array_ (Optional) The optional list of Reserved Instance IDs to describe. Pass a string for a single value, or an indexed array for multiple values.
  368. * Filter - _ComplexList_ (Optional) A list of filters used to match properties for ReservedInstances. For a complete reference to the available filter keys for this operation, see the Amazon EC2 API reference. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Filter` subtype (documented next), or by passing an associative array with the following `Filter`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  369. * Filter.x.Name - _string_ (Optional) Specifies the name of the filter.
  370. * Filter.x.Value.y - _string_ (Optional) Contains one or more values for the filter.
  371. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  372. *
  373. * Returns:
  374. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  375. */
  376. public function describe_reserved_instances($opt = null)
  377. {
  378. if (!$opt) $opt = array();
  379. // Optional parameter
  380. if (isset($opt['ReservedInstancesId']))
  381. {
  382. $opt = array_merge($opt, CFComplexType::map(array(
  383. 'ReservedInstancesId' => (is_array($opt['ReservedInstancesId']) ? $opt['ReservedInstancesId'] : array($opt['ReservedInstancesId']))
  384. )));
  385. unset($opt['ReservedInstancesId']);
  386. }
  387. // Optional parameter
  388. if (isset($opt['Filter']))
  389. {
  390. $opt = array_merge($opt, CFComplexType::map(array(
  391. 'Filter' => $opt['Filter']
  392. )));
  393. unset($opt['Filter']);
  394. }
  395. return $this->authenticate('DescribeReservedInstances', $opt, $this->hostname);
  396. }
  397. /**
  398. * Method: describe_subnets()
  399. * Gives you information about your subnets. You can filter the results to return information only
  400. * about subnets that match criteria you specify. For example, you could ask to get information about a
  401. * particular subnet (or all) only if the subnet's state is available. You can specify multiple filters
  402. * (e.g., the subnet is in a particular VPC, and the subnet's state is available). The result includes
  403. * information for a particular subnet only if the subnet matches all your filters. If there's no
  404. * match, no special message is returned; the response is simply empty. The following table shows the
  405. * available filters.
  406. *
  407. * Access:
  408. * public
  409. *
  410. * Parameters:
  411. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  412. *
  413. * Keys for the $opt parameter:
  414. * SubnetId - _string_|_array_ (Optional) A set of one or more subnet IDs. Pass a string for a single value, or an indexed array for multiple values.
  415. * Filter - _ComplexList_ (Optional) A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Filter` subtype (documented next), or by passing an associative array with the following `Filter`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  416. * Filter.x.Name - _string_ (Optional) Specifies the name of the filter.
  417. * Filter.x.Value.y - _string_ (Optional) Contains one or more values for the filter.
  418. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  419. *
  420. * Returns:
  421. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  422. */
  423. public function describe_subnets($opt = null)
  424. {
  425. if (!$opt) $opt = array();
  426. // Optional parameter
  427. if (isset($opt['SubnetId']))
  428. {
  429. $opt = array_merge($opt, CFComplexType::map(array(
  430. 'SubnetId' => (is_array($opt['SubnetId']) ? $opt['SubnetId'] : array($opt['SubnetId']))
  431. )));
  432. unset($opt['SubnetId']);
  433. }
  434. // Optional parameter
  435. if (isset($opt['Filter']))
  436. {
  437. $opt = array_merge($opt, CFComplexType::map(array(
  438. 'Filter' => $opt['Filter']
  439. )));
  440. unset($opt['Filter']);
  441. }
  442. return $this->authenticate('DescribeSubnets', $opt, $this->hostname);
  443. }
  444. /**
  445. * Method: describe_availability_zones()
  446. * The DescribeAvailabilityZones operation describes availability zones that are currently available to
  447. * the account and their states.
  448. *
  449. * Availability zones are not the same across accounts. The availability zone us-east-1a for account A
  450. * is not necessarily the same as us-east-1a for account B. Zone assignments are mapped independently
  451. * for each account.
  452. *
  453. * Access:
  454. * public
  455. *
  456. * Parameters:
  457. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  458. *
  459. * Keys for the $opt parameter:
  460. * ZoneName - _string_|_array_ (Optional) A list of the availability zone names to describe. Pass a string for a single value, or an indexed array for multiple values.
  461. * Filter - _ComplexList_ (Optional) A list of filters used to match properties for AvailabilityZones. For a complete reference to the available filter keys for this operation, see the Amazon EC2 API reference. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Filter` subtype (documented next), or by passing an associative array with the following `Filter`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  462. * Filter.x.Name - _string_ (Optional) Specifies the name of the filter.
  463. * Filter.x.Value.y - _string_ (Optional) Contains one or more values for the filter.
  464. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  465. *
  466. * Returns:
  467. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  468. */
  469. public function describe_availability_zones($opt = null)
  470. {
  471. if (!$opt) $opt = array();
  472. // Optional parameter
  473. if (isset($opt['ZoneName']))
  474. {
  475. $opt = array_merge($opt, CFComplexType::map(array(
  476. 'ZoneName' => (is_array($opt['ZoneName']) ? $opt['ZoneName'] : array($opt['ZoneName']))
  477. )));
  478. unset($opt['ZoneName']);
  479. }
  480. // Optional parameter
  481. if (isset($opt['Filter']))
  482. {
  483. $opt = array_merge($opt, CFComplexType::map(array(
  484. 'Filter' => $opt['Filter']
  485. )));
  486. unset($opt['Filter']);
  487. }
  488. return $this->authenticate('DescribeAvailabilityZones', $opt, $this->hostname);
  489. }
  490. /**
  491. * Method: detach_volume()
  492. * Detach a previously attached volume from a running instance.
  493. *
  494. * Access:
  495. * public
  496. *
  497. * Parameters:
  498. * $volume_id - _string_ (Required) The ID of the volume to detach.
  499. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  500. *
  501. * Keys for the $opt parameter:
  502. * InstanceId - _string_ (Optional) The ID of the instance from which to detach the the specified volume.
  503. * Device - _string_ (Optional) The device name to which the volume is attached on the specified instance.
  504. * Force - _boolean_ (Optional) Forces detachment if the previous detachment attempt did not occur cleanly (logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures.
  505. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  506. *
  507. * Returns:
  508. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  509. */
  510. public function detach_volume($volume_id, $opt = null)
  511. {
  512. if (!$opt) $opt = array();
  513. $opt['VolumeId'] = $volume_id;
  514. return $this->authenticate('DetachVolume', $opt, $this->hostname);
  515. }
  516. /**
  517. * Method: delete_key_pair()
  518. * The DeleteKeyPair operation deletes a key pair.
  519. *
  520. * Access:
  521. * public
  522. *
  523. * Parameters:
  524. * $key_name - _string_ (Required) The name of the Amazon EC2 key pair to delete.
  525. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  526. *
  527. * Keys for the $opt parameter:
  528. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  529. *
  530. * Returns:
  531. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  532. */
  533. public function delete_key_pair($key_name, $opt = null)
  534. {
  535. if (!$opt) $opt = array();
  536. $opt['KeyName'] = $key_name;
  537. return $this->authenticate('DeleteKeyPair', $opt, $this->hostname);
  538. }
  539. /**
  540. * Method: describe_instances()
  541. * The DescribeInstances operation returns information about instances that you own.
  542. *
  543. * If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you
  544. * do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you
  545. * specify an invalid instance ID, a fault is returned. If you specify an instance that you do not own,
  546. * it will not be included in the returned results.
  547. *
  548. * Recently terminated instances might appear in the returned results. This interval is usually less
  549. * than one hour.
  550. *
  551. * Access:
  552. * public
  553. *
  554. * Parameters:
  555. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  556. *
  557. * Keys for the $opt parameter:
  558. * InstanceId - _string_|_array_ (Optional) An optional list of the instances to describe. Pass a string for a single value, or an indexed array for multiple values.
  559. * Filter - _ComplexList_ (Optional) A list of filters used to match properties for Instances. For a complete reference to the available filter keys for this operation, see the Amazon EC2 API reference. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Filter` subtype (documented next), or by passing an associative array with the following `Filter`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  560. * Filter.x.Name - _string_ (Optional) Specifies the name of the filter.
  561. * Filter.x.Value.y - _string_ (Optional) Contains one or more values for the filter.
  562. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  563. *
  564. * Returns:
  565. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  566. */
  567. public function describe_instances($opt = null)
  568. {
  569. if (!$opt) $opt = array();
  570. // Optional parameter
  571. if (isset($opt['InstanceId']))
  572. {
  573. $opt = array_merge($opt, CFComplexType::map(array(
  574. 'InstanceId' => (is_array($opt['InstanceId']) ? $opt['InstanceId'] : array($opt['InstanceId']))
  575. )));
  576. unset($opt['InstanceId']);
  577. }
  578. // Optional parameter
  579. if (isset($opt['Filter']))
  580. {
  581. $opt = array_merge($opt, CFComplexType::map(array(
  582. 'Filter' => $opt['Filter']
  583. )));
  584. unset($opt['Filter']);
  585. }
  586. return $this->authenticate('DescribeInstances', $opt, $this->hostname);
  587. }
  588. /**
  589. * Method: describe_images()
  590. * The DescribeImages operation returns information about AMIs, AKIs, and ARIs available to the user.
  591. * Information returned includes image type, product codes, architecture, and kernel and RAM disk IDs.
  592. * Images available to the user include public images available for any user to launch, private images
  593. * owned by the user making the request, and private images owned by other users for which the user has
  594. * explicit launch permissions.
  595. *
  596. * Launch permissions fall into three categories:
  597. *
  598. * - Public: The owner of the AMI granted launch permissions for the AMI to the all group. All users
  599. * have launch permissions for these AMIs.
  600. *
  601. * - Explicit: The owner of the AMI granted launch permissions to a specific user.
  602. *
  603. * - Implicit: A user has implicit launch permissions for all AMIs he or she owns.
  604. *
  605. * The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or users with launch
  606. * permissions. If no options are specified, Amazon EC2 returns all AMIs for which the user has launch
  607. * permissions.
  608. *
  609. * If you specify one or more AMI IDs, only AMIs that have the specified IDs are returned. If you
  610. * specify an invalid AMI ID, a fault is returned. If you specify an AMI ID for which you do not have
  611. * access, it will not be included in the returned results.
  612. *
  613. * If you specify one or more AMI owners, only AMIs from the specified owners and for which you have
  614. * access are returned. The results can include the account IDs of the specified owners, amazon for
  615. * AMIs owned by Amazon or self for AMIs that you own.
  616. *
  617. * If you specify a list of executable users, only users that have launch permissions for the AMIs are
  618. * returned. You can specify account IDs (if you own the AMI(s)), self for AMIs for which you own or
  619. * have explicit permissions, or all for public AMIs.
  620. *
  621. * Deregistered images are included in the returned results for an unspecified interval after
  622. * deregistration.
  623. *
  624. * Access:
  625. * public
  626. *
  627. * Parameters:
  628. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  629. *
  630. * Keys for the $opt parameter:
  631. * ImageId - _string_|_array_ (Optional) An optional list of the AMI IDs to describe. If not specified, all AMIs will be described. Pass a string for a single value, or an indexed array for multiple values.
  632. * Owner - _string_|_array_ (Optional) The optional list of owners for the described AMIs. The IDs amazon, self, and explicit can be used to include AMIs owned by Amazon, AMIs owned by the user, and AMIs for which the user has explicit launch permissions, respectively. Pass a string for a single value, or an indexed array for multiple values.
  633. * ExecutableBy - _string_|_array_ (Optional) The optional list of users with explicit launch permissions for the described AMIs. The user ID can be a user's account ID, 'self' to return AMIs for which the sender of the request has explicit launch permissions, or 'all' to return AMIs with public launch permissions. Pass a string for a single value, or an indexed array for multiple values.
  634. * Filter - _ComplexList_ (Optional) A list of filters used to match properties for Images. For a complete reference to the available filter keys for this operation, see the Amazon EC2 API reference. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Filter` subtype (documented next), or by passing an associative array with the following `Filter`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  635. * Filter.x.Name - _string_ (Optional) Specifies the name of the filter.
  636. * Filter.x.Value.y - _string_ (Optional) Contains one or more values for the filter.
  637. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  638. *
  639. * Returns:
  640. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  641. */
  642. public function describe_images($opt = null)
  643. {
  644. if (!$opt) $opt = array();
  645. // Optional parameter
  646. if (isset($opt['ImageId']))
  647. {
  648. $opt = array_merge($opt, CFComplexType::map(array(
  649. 'ImageId' => (is_array($opt['ImageId']) ? $opt['ImageId'] : array($opt['ImageId']))
  650. )));
  651. unset($opt['ImageId']);
  652. }
  653. // Optional parameter
  654. if (isset($opt['Owner']))
  655. {
  656. $opt = array_merge($opt, CFComplexType::map(array(
  657. 'Owner' => (is_array($opt['Owner']) ? $opt['Owner'] : array($opt['Owner']))
  658. )));
  659. unset($opt['Owner']);
  660. }
  661. // Optional parameter
  662. if (isset($opt['ExecutableBy']))
  663. {
  664. $opt = array_merge($opt, CFComplexType::map(array(
  665. 'ExecutableBy' => (is_array($opt['ExecutableBy']) ? $opt['ExecutableBy'] : array($opt['ExecutableBy']))
  666. )));
  667. unset($opt['ExecutableBy']);
  668. }
  669. // Optional parameter
  670. if (isset($opt['Filter']))
  671. {
  672. $opt = array_merge($opt, CFComplexType::map(array(
  673. 'Filter' => $opt['Filter']
  674. )));
  675. unset($opt['Filter']);
  676. }
  677. return $this->authenticate('DescribeImages', $opt, $this->hostname);
  678. }
  679. /**
  680. * Method: start_instances()
  681. * Starts an instance that uses an Amazon EBS volume as its root device. Instances that use Amazon EBS
  682. * volumes as their root devices can be quickly stopped and started. When an instance is stopped, the
  683. * compute resources are released and you are not billed for hourly instance usage. However, your root
  684. * partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon
  685. * EBS volume usage. You can restart your instance at any time.
  686. *
  687. * Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an
  688. * instance does not preserve data stored in RAM.
  689. *
  690. * Performing this operation on an instance that uses an instance store as its root device returns an
  691. * error.
  692. *
  693. * Access:
  694. * public
  695. *
  696. * Parameters:
  697. * $instance_id - _string_|_array_ (Required) The list of Amazon EC2 instances to start. Pass a string for a single value, or an indexed array for multiple values.
  698. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  699. *
  700. * Keys for the $opt parameter:
  701. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  702. *
  703. * Returns:
  704. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  705. */
  706. public function start_instances($instance_id, $opt = null)
  707. {
  708. if (!$opt) $opt = array();
  709. // Required parameter
  710. $opt = array_merge($opt, CFComplexType::map(array(
  711. 'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
  712. )));
  713. return $this->authenticate('StartInstances', $opt, $this->hostname);
  714. }
  715. /**
  716. * Method: unmonitor_instances()
  717. * Disables monitoring for a running instance.
  718. *
  719. * Access:
  720. * public
  721. *
  722. * Parameters:
  723. * $instance_id - _string_|_array_ (Required) The list of Amazon EC2 instances on which to disable monitoring. Pass a string for a single value, or an indexed array for multiple values.
  724. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  725. *
  726. * Keys for the $opt parameter:
  727. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  728. *
  729. * Returns:
  730. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  731. */
  732. public function unmonitor_instances($instance_id, $opt = null)
  733. {
  734. if (!$opt) $opt = array();
  735. // Required parameter
  736. $opt = array_merge($opt, CFComplexType::map(array(
  737. 'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
  738. )));
  739. return $this->authenticate('UnmonitorInstances', $opt, $this->hostname);
  740. }
  741. /**
  742. * Method: attach_vpn_gateway()
  743. * Attaches a VPN gateway to a VPC. This is the last step required to get your VPC fully connected to
  744. * your data center before launching instances in it. For more information, go to Process for Using
  745. * Amazon VPC in the Amazon Virtual Private Cloud Developer Guide.
  746. *
  747. * Access:
  748. * public
  749. *
  750. * Parameters:
  751. * $vpn_gateway_id - _string_ (Required) The ID of the VPN gateway to attach to the VPC.
  752. * $vpc_id - _string_ (Required) The ID of the VPC to attach to the VPN gateway.
  753. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  754. *
  755. * Keys for the $opt parameter:
  756. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  757. *
  758. * Returns:
  759. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  760. */
  761. public function attach_vpn_gateway($vpn_gateway_id, $vpc_id, $opt = null)
  762. {
  763. if (!$opt) $opt = array();
  764. $opt['VpnGatewayId'] = $vpn_gateway_id;
  765. $opt['VpcId'] = $vpc_id;
  766. return $this->authenticate('AttachVpnGateway', $opt, $this->hostname);
  767. }
  768. /**
  769. * Method: modify_instance_attribute()
  770. * Modifies an attribute of an instance.
  771. *
  772. * Access:
  773. * public
  774. *
  775. * Parameters:
  776. * $instance_id - _string_ (Required) The ID of the instance whose attribute is being modified.
  777. * $attribute - _string_ (Required) The name of the attribute being modified. Available attribute names: instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDevice, blockDeviceMapping
  778. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  779. *
  780. * Keys for the $opt parameter:
  781. * Value - _string_ (Optional) The new value of the instance attribute being modified. Only valid when kernel, ramdisk, userData disableApiTermination, or instanceInitiateShutdownBehavior is specified as the attribute being modified.
  782. * BlockDeviceMapping - _ComplexList_ (Optional) The new block device mappings for the instance whose attributes are being modified. Only valid when blockDeviceMapping is specified as the attribute being modified. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `BlockDeviceMapping` subtype (documented next), or by passing an associative array with the following `BlockDeviceMapping`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example.
  783. * BlockDeviceMapping.x.DeviceName - _string_ (Optional) The device name (e.g., /dev/sdh) at which the block device is exposed on the instance.
  784. * BlockDeviceMapping.x.Ebs.VolumeId - _string_ (Optional) The ID of the EBS volume that should be mounted as a block device on an Amazon EC2 instance.
  785. * BlockDeviceMapping.x.Ebs.DeleteOnTermination - _boolean_ (Optional) Specifies whether the Amazon EBS volume is deleted on instance termination.
  786. * BlockDeviceMapping.x.VirtualName - _string_ (Optional) The virtual device name.
  787. * BlockDeviceMapping.x.NoDevice - _string_ (Optional) When set to the empty string, specifies that the device name in this object should not be mapped to any real device.
  788. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  789. *
  790. * Returns:
  791. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  792. */
  793. public function modify_instance_attribute($instance_id, $attribute, $opt = null)
  794. {
  795. if (!$opt) $opt = array();
  796. $opt['InstanceId'] = $instance_id;
  797. $opt['Attribute'] = $attribute;
  798. // Optional parameter
  799. if (isset($opt['BlockDeviceMapping']))
  800. {
  801. $opt = array_merge($opt, CFComplexType::map(array(
  802. 'BlockDeviceMapping' => $opt['BlockDeviceMapping']
  803. )));
  804. unset($opt['BlockDeviceMapping']);
  805. }
  806. return $this->authenticate('ModifyInstanceAttribute', $opt, $this->hostname);
  807. }
  808. /**
  809. * Method: delete_dhcp_options()
  810. * Deletes a set of DHCP options that you specify. Amazon VPC returns an error if the set of options
  811. * you specify is currently associated with a VPC. You can disassociate the set of options by
  812. * associating either a new set of options or the default options with the VPC.
  813. *
  814. * Access:
  815. * public
  816. *
  817. * Parameters:
  818. * $dhcp_options_id - _string_ (Required) The ID of the DHCP options set to delete.
  819. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  820. *
  821. * Keys for the $opt parameter:
  822. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  823. *
  824. * Returns:
  825. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  826. */
  827. public function delete_dhcp_options($dhcp_options_id, $opt = null)
  828. {
  829. if (!$opt) $opt = array();
  830. $opt['DhcpOptionsId'] = $dhcp_options_id;
  831. return $this->authenticate('DeleteDhcpOptions', $opt, $this->hostname);
  832. }
  833. /**
  834. * Method: delete_security_group()
  835. * The DeleteSecurityGroup operation deletes a security group.
  836. *
  837. * If you attempt to delete a security group that contains instances, a fault is returned.
  838. *
  839. * If you attempt to delete a security group that is referenced by another security group, a fault is
  840. * returned. For example, if security group B has a rule that allows access from security group A,
  841. * security group A cannot be deleted until the allow rule is removed.
  842. *
  843. * Access:
  844. * public
  845. *
  846. * Parameters:
  847. * $group_name - _string_ (Required) The name of the Amazon EC2 security group to delete.
  848. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  849. *
  850. * Keys for the $opt parameter:
  851. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  852. *
  853. * Returns:
  854. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  855. */
  856. public function delete_security_group($group_name, $opt = null)
  857. {
  858. if (!$opt) $opt = array();
  859. $opt['GroupName'] = $group_name;
  860. return $this->authenticate('DeleteSecurityGroup', $opt, $this->hostname);
  861. }
  862. /**
  863. * Method: create_image()
  864. * Creates an Amazon EBS-backed AMI from a "running" or "stopped" instance. AMIs that use an Amazon EBS
  865. * root device boot faster than AMIs that use instance stores. They can be up to 1 TiB in size, use
  866. * storage that persists on instance failure, and can be stopped and started.
  867. *
  868. * Access:
  869. * public
  870. *
  871. * Parameters:
  872. * $instance_id - _string_ (Required) The ID of the instance from which to create the new image.
  873. * $name - _string_ (Required) The name for the new AMI being created.
  874. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  875. *
  876. * Keys for the $opt parameter:
  877. * Description - _string_ (Optional) The description for the new AMI being created.
  878. * NoReboot - _boolean_ (Optional) By default this property is set to `false`, which means Amazon EC2 attempts to cleanly shut down the instance before image creation and reboots the instance afterwards. When set to true, Amazon EC2 will not shut down the instance before creating the image. When this option is used, file system integrity on the created image cannot be guaranteed.
  879. * returnCurlHandle - _boolean_ (Optional) A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
  880. *
  881. * Returns:
  882. * _CFResponse_ A <CFResponse> object containing a parsed HTTP response.
  883. */
  884. public function create_image($instance_id, $name, $opt = null)
  885. {
  886. if (!$opt) $opt = array();
  887. $opt['InstanceId'] = $instance_id;
  888. $opt['Name'] = $name;
  889. return $this->authenticate('CreateImage', $opt, $this->hostname);
  890. }
  891. /**
  892. * Method: authorize_security_group_ingress()
  893. * The AuthorizeSecurityGroupIngress operation adds permissions to a security group.
  894. *
  895. * Permissions are specified by the IP protocol (TCP, UDP or ICMP), the source of the request (by IP
  896. * range or an Amazon EC2 user-group pair), the source and destination port ranges (for TCP and UDP),
  897. * and the ICMP codes and types (for ICMP). When authorizing ICMP, -1 can be used as a wildcard in the
  898. * type and code fields.
  899. *
  900. * Permission changes are propagated to instances within the security group as quickly as possible.
  901. * However, depending on the number of instances, a small delay might occur.
  902. *
  903. * Access:
  904. * public
  905. *
  906. * Parameters:
  907. * $group_name - _string_ (Required) Name of the group to modify. The name must be valid and belong to the account.
  908. * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section.
  909. *
  910. * Keys for the $opt parameter:
  911. * SourceSecurityGroupName - _string_ (Optional) Deprecated - use the list of IP permissions to specify this information instead. Name of the security group. Cannot be used when specifying a CIDR IP address.
  912. * SourceSecurityGroupOwnerId - _string_ (Optional) Deprecated - use the list of IP permissions to specify this information instead. AWS user ID of an account. Cannot be used when specifying a CIDR IP address.
  913. * IpProtocol - _string_ (Optional) Deprecated - use the list of IP permissions to specify this information instead. IP protocol.
  914. * FromPort - _integer_ (Optional) Deprecated - use the list of IP permissions to specify this information instead. Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).
  915. * ToPort - _integer_ (Optional) Deprecated - use the list of IP permissions to specify this information instead. End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).
  916. * CidrIp - _string_ (Optional) Deprecated - use the list of IP permissions to specify this information instead. CIDR range.
  917. * IpPermissions - _ComplexList_ (Optional) List of IP permissions to authorize on the specified security group. Specifying permissions through IP permissions is the preferred way of authorizing permissions since it offers more flexibility and control. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individ…

Large files files are truncated, but you can click here to view the full file