Amazon Elastic Compute Cloud (http://aws.amazon.com/ec2)
2010.01.10
2006-2009 Foleeo, Inc., and contributors.
| Simplified BSD License | http://opensource.org/licenses/bsd-license.php |
| CloudFusion | http://getcloudfusion.com |
| Amazon EC2 | http://aws.amazon.com/ec2 |
Specify the default queue URL.
Specify the queue URL for the U.S.-specific hostname.
Specify the queue URL for the E.U.-specific hostname.
Container for all Amazon EC2-related methods. Inherits additional methods from CloudFusion.
CloudFusion
require_once('cloudfusion.class.php');
// Instantiate a new AmazonEC2 object using the settings from the config.inc.php file.
$s3 = new AmazonEC2();
// Instantiate a new AmazonEC2 object using these specific settings.
$s3 = new AmazonEC2($key, $secret_key);Stores the hostname to use to make the request.
public function __construct( $key = null, $secret_key = null, $account_id = null )
The constructor
public
| key | string (Optional) Your Amazon API Key. If blank, it will look for the AWS_KEY constant. |
| secret_key | string (Optional) Your Amazon API Secret Key. If blank, it will look for the AWS_SECRET_KEY constant. |
| account_id | string (Optional) Your Amazon Account ID, without hyphens. If blank, it will look for the AWS_ACCOUNT_ID constant. |
boolean false if no valid values are set, otherwise true.
| Example Usage | http://getcloudfusion.com |
public function set_locale( $locale )
By default EC2 will self-select the most appropriate locale. This allows you to explicitly sets the locale for EC2 to use.
public
| locale | string (Required) The locale to explicitly set for EC2. Available options are EC2_LOCATION_US and EC2_LOCATION_EU. |
void
| Example Usage | http://getcloudfusion.com |
public function describe_availability_zones( $opt = null )
Describes availability zones that are currently available to the account and their states.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| ZoneName.n | string (Optional) Name of an availability zone. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function allocate_address( $returnCurlHandle = null )
Acquires an elastic IP address for use with your account.
public
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function associate_address( $instance_id, $public_ip, $returnCurlHandle = null )
Associates an elastic IP address with an instance.
If the IP address is currently assigned to another instance, the IP address is assigned to the new instance. This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.
public
| instance_id | string (Required) The instance to which the IP address is assigned. |
| public_ip | string (Required) IP address that you are assigning to the instance, retrieved from allocate_address(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function describe_addresses( $opt = null )
Lists elastic IP addresses assigned to your account.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| PublicIp.1 | string (Required but can be empty) One Elastic IP addresses to describe. |
| PublicIp.n | string (Optional) More than one Elastic IP addresses to describe. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function disassociate_address( $public_ip, $returnCurlHandle = null )
Disassociates the specified elastic IP address from the instance to which it is assigned.
This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.
public
| public_ip | string (Required) IP address that you are disassociating from the instance. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function release_address( $public_ip, $returnCurlHandle = null )
Releases an elastic IP address associated with your account. If you run this operation on an elastic IP address that is already released, the address might be assigned to another account which will cause Amazon EC2 to return an error.
Releasing an IP address automatically disassociates it from any instance with which it is associated. For more information, see disassociate_address().
After releasing an elastic IP address, it is released to the IP address pool and might no longer be available to your account. Make sure to update your DNS records and any servers or devices that communicate with the address.
public
| public_ip | string (Required) IP address that you are releasing from your account. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function create_snapshot( $volume_id, $returnCurlHandle = null )
Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to launch instances from identical snapshots, and to save data before shutting down an instance. For more information, see Amazon Elastic Block Store.
public
| volume_id | string (Required) The ID of the Amazon EBS volume to snapshot. Must be a volume that you own. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | describe_snapshots(), delete_snapshot() |
public function describe_snapshots( $opt = null )
Describes the status of Amazon EBS snapshots.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| SnapshotId.n | string (Optional) The ID of the Amazon EBS snapshot. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_snapshot(), delete_snapshot() |
public function delete_snapshot( $snapshot_id, $returnCurlHandle = null )
Deletes a snapshot of an Amazon EBS volume that is stored in Amazon S3.
public
| snapshot_id | string (Optional) The ID of the Amazon EBS snapshot to delete. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_snapshot(), describe_snapshots() |
public function create_volume( $sizesnapid, $zone, $returnCurlHandle = null )
Creates a new Amazon EBS volume that you can mount from any Amazon EC2 instance. You must specify an availability zone when creating a volume. The volume and any instance to which it attaches must be in the same availability zone.
public
| sizesnapid | mixed (Required) Either the size of the volume in GB as an integer (from 1 to 1024), or the ID of the snapshot from which to create the new volume as a string. |
| zone | string (Required) The availability zone in which to create the new volume. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | describe_volumes(), attach_volume(), detach_volume(), delete_volume() |
public function describe_volumes( $opt = null )
Lists one or more Amazon EBS volumes that you own. If you do not specify any volumes, Amazon EBS returns all volumes that you own.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| VolumeId.n | string (Optional) The ID of the volume to list. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_volume(), attach_volume(), detach_volume(), delete_volume() |
public function attach_volume( $volume_id, $instance_id, $device, $returnCurlHandle = null )
Attaches an Amazon EBS volume to an instance.
public
| volume_id | string (Required) The ID of the Amazon EBS volume. |
| instance_id | string (Required) The ID of the instance to which the volume attaches. |
| device | string (Required) Specifies how the device is exposed to the instance (e.g., /dev/sdh). For information on standard storage locations, see Storage Locations. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function detach_volume( $volume_id, $opt = null )
Detaches an Amazon EBS volume from an instance.
public
| volume_id | string (Required) The ID of the Amazon EBS volume. |
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| InstanceId | string (Optional) The ID of the instance from which the volume will detach. |
| Device | string (Optional) The name of the device. |
| 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 an instance 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. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_volume(), describe_volumes(), attach_volume(), delete_volume() |
public function delete_volume( $volume_id, $returnCurlHandle = null )
Deletes an Amazon EBS volume.
public
| volume_id | string (Required) The ID of the Amazon EBS volume. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_volume(), describe_volumes(), attach_volume(), detach_volume() |
public function get_console_output( $instance_id, $returnCurlHandle = null )
Retrieves console output for the specified instance. Instance console output is buffered and posted shortly after instance boot, reboot, and termination. Amazon EC2 preserves the most recent 64 KB output which will be available for at least one hour after the most recent post.
public
| instance_id | string (Required) An instance ID returned from a previous call to run_instances(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | reboot_instances() |
public function reboot_instances( $opt = null )
Requests a reboot of one or more instances. This operation is asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed if the instances are valid and belong to the user. Requests to reboot terminated instances are ignored.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| InstanceId.1 | string (Required) One instance ID returned from previous calls to run_instances(). |
| InstanceId.n | string (Optional) More than one instance IDs returned from previous calls to run_instances(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | get_console_output() |
public function deregister_image( $image_id, $returnCurlHandle = null )
De-registers an AMI. Once de-registered, instances of the AMI may no longer be launched.
public
| image_id | string (Required) Unique ID of a machine image, returned by a call to register_image() or describe_images(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | describe_images(), register_image() |
public function describe_images( $opt = null )
The DescribeImages operation returns information about AMIs, AKIs, and ARIs available to the user. Information returned includes image type, product codes, architecture, and kernel and RAM disk IDs. Images available to the user include public images available for any user to launch, private images owned by the user making the request, and private images owned by other users for which the user has explicit launch permissions.
Launch permissions fall into three categories: (a) ‘public’ where the owner of the AMI granted launch permissions for the AMI to the all group. All users have launch permissions for these AMIs. (b) ‘explicit’ where the owner of the AMI granted launch permissions to a specific user. (c) ‘implicit’ where a user has implicit launch permissions for all AMIs he or she owns.
The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or users with launch permissions. If no options are specified, Amazon EC2 returns all AMIs for which the user has launch permissions.
If you specify one or more AMI IDs, only AMIs that have the specified IDs are returned. If you specify an invalid AMI ID, a fault is returned. If you specify an AMI ID for which you do not have access, it will not be included in the returned results.
If you specify one or more AMI owners, only AMIs from the specified owners and for which you have access are returned. The results can include the account IDs of the specified owners, amazon for AMIs owned by Amazon or self for AMIs that you own.
If you specify a list of executable users, only users that have launch permissions for the AMIs are returned. You can specify account IDs (if you own the AMI(s)), self for AMIs for which you own or have explicit permissions, or all for public AMIs.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| ExecutableBy.n | string (Optional) Describe AMIs that the specified users have launch permissions for. Accepts Amazon account ID, ‘self’, or ‘all’ for public AMIs. |
| ImageId.n | string (Optional) A list of image descriptions. |
| Owner.n | string (Optional) Owners of AMIs to describe. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | deregister_image(), register_image() |
public function register_image( $image_location, $returnCurlHandle = null )
Registers an AMI with Amazon EC2. Images must be registered before they can be launched. For more information, see run_instances().
Each AMI is associated with an unique ID which is provided by the Amazon EC2 service through the register_image() operation. During registration, Amazon EC2 retrieves the specified image manifest from Amazon S3 and verifies that the image is owned by the user registering the image.
The image manifest is retrieved once and stored within the Amazon EC2. Any modifications to an image in Amazon S3 invalidates this registration. If you make changes to an image, deregister the previous image and register the new image. For more information, see deregister_image().
public
| image_location | string (Required) Full path to your AMI manifest in Amazon S3 storage (i.e. mybucket/myimage.manifest.xml). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | deregister_image(), describe_images() |
public function describe_image_attribute( $image_id, $returnCurlHandle = null )
Returns information about an attribute of an AMI. Only one attribute may be specified per call.
public
| image_id | string (Required) ID of the AMI for which an attribute will be described, returned by a call to register_image() or describe_images(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | modify_image_attribute(), reset_image_attribute() |
public function modify_image_attribute( $image_id, $attribute, $opt = null )
Modifies an attribute of an AMI.
public
| image_id | string (Required) AMI ID to modify an attribute on. |
| attribute | string (Required) Specifies the attribute to modify. Supports ‘launchPermission’ and ‘productCodes’. |
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| OperationType | string (Required for ‘launchPermission’ Attribute) Specifies the operation to perform on the attribute. Supports ‘add’ and ‘remove’. |
| UserId.n | string (Required for ‘launchPermission’ Attribute) User IDs to add to or remove from the ‘launchPermission’ attribute. |
| UserGroup.n | string (Required for ‘launchPermission’ Attribute) User groups to add to or remove from the ‘launchPermission’ attribute. Currently, only the ‘all’ group is available, specifiying all Amazon EC2 users. |
| ProductCode.n | string (Required for ‘productCodes’ Attribute) Attaches product codes to the AMI. Currently only one product code may be associated with an AMI. Once set, the product code can not be changed or reset. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | describe_image_attribute(), reset_image_attribute() |
public function reset_image_attribute( $image_id, $returnCurlHandle = null )
Resets an attribute of an AMI to its default value (the productCodes attribute cannot be reset).
public
| image_id | string (Required) ID of the AMI for which an attribute will be described, returned by a call to register_image() or describe_images(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | describe_image_attribute(), modify_image_attribute() |
public function confirm_product_instance( $product_code, $instance_id, $returnCurlHandle = null )
Returns true if the given product code is attached to the instance with the given instance ID. The operation returns false if the product code is not attached to the instance.
Can only be executed by the owner of the AMI. This feature is useful when an AMI owner is providing support and wants to verify whether a user’s instance is eligible.
public
| product_code | string (Required) The product code to confirm is attached to the instance. |
| instance_id | string (Required) The instance for which to confirm the product code. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | describe_instances(), run_instances(), terminate_instances() |
public function describe_instances( $opt = null )
Returns information about instances owned by the user making the request.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| InstanceId.n | string (Required) Set of instances IDs to get the status of. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | confirm_product_instance(), run_instances(), terminate_instances() |
public function run_instances( $image_id, $min_count, $max_count, $opt = null )
The RunInstances operation launches a specified number of instances. The Query version of run_instances() only allows instances of a single AMI to be launched in one call. This is different from the SOAP API version of the call, but similar to the ec2-run-instances command line tool.
If Amazon EC2 cannot launch the minimum number AMIs you request, no instances launch. If there is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches as many as possible to satisfy the requested maximum values.
Every instance is launched in a security group. If you do not specify a security group at launch, the instances start in your default security group. For more information on creating security groups, see create_security_group().
You can provide an optional key pair ID for each image in the launch request (for more information, see create_key_pair()). All instances that are created from images that use this key pair will have access to the associated public key at boot. You can use this key to provide secure access to an instance of an image on a per-instance basis. Amazon EC2 public images use this feature to provide secure access without passwords. IMPORTANT: Launching public images without a key pair ID will leave them inaccessible.
The public key material is made available to the instance at boot time by placing it in the openssh_id.pub file on a logical device that is exposed to the instance as /dev/sda2 (the instance store). The format of this file is suitable for use as an entry within ~/.ssh/authorized_keys (the OpenSSH format). This can be done at boot (e.g., as part of rc.local) allowing for secure access without passwords.
Optional user data can be provided in the launch request. All instances that collectively comprise the launch request have access to this data For more information, see Instance Metadata. NOTE: If any of the AMIs have a product code attached for which the user has not subscribed, the run_instances() call will fail.
IMPORTANT: We strongly recommend using the 2.6.18 Xen stock kernel with the c1.medium and c1.xlarge instances. Although the default Amazon EC2 kernels will work, the new kernels provide greater stability and performance for these instance types. For more information about kernels, see Kernels, RAM Disks, and Block Device Mappings.
public
| image_id | string (Required) ID of the AMI to launch instances based on. |
| min_count | integer (Required) Minimum number of instances to launch. |
| max_count | integer (Required) Maximum number of instances to launch. |
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| BlockDeviceMapping.n.DeviceName | string (Optional; Required if BlockDeviceMapping.n.VirtualName is used) Specifies the device to which you are mapping a virtual name. For example: sdb. |
| BlockDeviceMapping.n.VirtualName | string (Optional; Required if BlockDeviceMapping.n.DeviceName is used) Specifies the virtual name to map to the corresponding device name. For example: instancestore0. |
| InstanceType | string (Optional) Specifies the instance type. Options include ‘m1.small’, ‘m1.large’, ‘m1.xlarge’, ‘c1.medium’, and ‘c1.xlarge’. Defaults to ‘m1.small’. |
| KernelId | string (Optional) The ID of the kernel with which to launch the instance. For information on finding available kernel IDs, see ec2-describe-images. |
| KeyName | string (Optional) Name of the keypair to launch instances with. |
| Placement.AvailabilityZone | string (Optional) Specifies the availability zone in which to launch the instance(s). To display a list of availability zones in which you can launch the instances, use the describe_availability_zones() operation. Default is determined by Amazon EC2. |
| 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. |
| SecurityGroup.n | string (Optional) Names of the security groups to associate the instances with. |
| UserData | string (Optional) The user data available to the launched instances. This should be base64-encoded. See the UserDataType data type for encoding details. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function terminate_instances( $opt = null )
Shuts down one or more instances. This operation is idempotent and terminating an instance that is in the process of shutting down (or already terminated) will succeed.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| InstanceId.1 | string (Required) One instance ID returned from previous calls to run_instances(). |
| InstanceId.n | string (Optional) More than one instance IDs returned from previous calls to run_instances(). |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function create_key_pair( $key_name, $returnCurlHandle = null )
Creates a new 2048 bit RSA key pair and returns a unique ID that can be used to reference this key pair when launching new instances. For more information, see run_instances().
public
| key_name | string (Required) A unique name for the key pair. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | delete_key_pair(), describe_key_pairs() |
public function delete_key_pair( $key_name, $returnCurlHandle = null )
Deletes a keypair.
public
| key_name | string (Required) Unique name for this key. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_key_pair(), describe_key_pairs() |
public function describe_key_pairs( $opt = null )
Returns information about key pairs available to you. If you specify key pairs, information about those key pairs is returned. Otherwise, information for all registered key pairs is returned.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| KeyName.n | string (Optional) One or more keypair IDs to describe. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
| AWS Method | http://docs.amazonwebservices.com |
| Related | create_key_pair(), delete_key_pair() |
public function authorize_security_group_ingress( $group_name, $opt = null )
Adds permissions to a security group.
Permissions are specified in terms of the IP protocol (TCP, UDP or ICMP), the source of the request (by IP range or an Amazon EC2 user-group pair), source and destination port ranges (for TCP and UDP), and ICMP codes and types (for ICMP). When authorizing ICMP, -1 may be used as a wildcard in the type and code fields.
Permission changes are propagated to instances within the security group being modified as quickly as possible. However, a small delay is likely, depending on the number of instances that are members of the indicated group.
When authorizing a user/group pair permission, group_name, SourceSecurityGroupName and SourceSecurityGroupOwnerId must be specified. When authorizing a CIDR IP permission, GroupName, IpProtocol, FromPort, ToPort and CidrIp must be specified. Mixing these two types of parameters is not allowed.
public
| group_name | string (Required) Name of the security group to modify. |
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| CidrIp | string (Required when authorizing CIDR IP permission) CIDR IP range to authorize access to when operating on a CIDR IP. |
| FromPort | integer (Required when authorizing CIDR IP permission) Bottom of port range to authorize access to when operating on a CIDR IP. This contains the ICMP type if ICMP is being authorized. |
| ToPort | integer (Required when authorizing CIDR IP permission) Top of port range to authorize access to when operating on a CIDR IP. This contains the ICMP code if ICMP is being authorized. |
| IpProtocol | string (Required when authorizing CIDR IP permission) IP protocol to authorize access to when operating on a CIDR IP. Valid values are ‘tcp’, ‘udp’ and ‘icmp’. |
| SourceSecurityGroupName | string (Required when authorizing user/group pair permission) Name of security group to authorize access to when operating on a user/group pair. |
| SourceSecurityGroupOwnerId | string (Required when authorizing user/group pair permission) Owner of security group to authorize access to when operating on a user/group pair. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function create_security_group( $group_name, $group_description, $returnCurlHandle = null )
Every instance is launched in a security group. If none is specified as part of the launch request then instances are launched in the default security group. Instances within the same security group have unrestricted network access to one another. Instances will reject network access attempts from other instances in a different security group. As the owner of instances you may grant or revoke specific permissions using the authorize_security_group_ingress() and revoke_security_group_ingress() operations.
public
| group_name | string (Required) Name for the new security group. |
| group_description | string (Required) Description of the new security group. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function delete_security_group( $group_name, $returnCurlHandle = null )
Deletes a security group.
If you attempt to delete a security group that contains instances, a fault is returned. If you attempt to delete a security group that is referenced by another security group, a fault is returned. For example, if security group B has a rule that allows access from security group A, security group A cannot be deleted until the allow rule is removed.
public
| group_name | string (Required) Name for the security group. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function describe_security_groups( $opt = null )
Returns information about security groups owned by the user making the request. An optional list of security group names may be provided to request information for those security groups only. If no security group names are provided, information of all security groups will be returned. If a group is specified that does not exist a fault is returned.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| GroupName.n | string (Optional) List of security groups to describe. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function revoke_security_group_ingress( $group_name, $opt = null )
Revokes existing permissions that were previously granted to a security group. The permissions to revoke must be specified using the same values originally used to grant the permission.
Permissions are specified in terms of the IP protocol (TCP, UDP or ICMP), the source of the request (by IP range or an Amazon EC2 user-group pair), source and destination port ranges (for TCP and UDP), and ICMP codes and types (for ICMP). When authorizing ICMP, -1 may be used as a wildcard in the type and code fields.
Permission changes are propagated to instances within the security group being modified as quickly as possible. However, a small delay is likely, depending on the number of instances that are members of the indicated group.
When revoking a user/group pair permission, group_name, SourceSecurityGroupName and SourceSecurityGroupOwnerId must be specified. When authorizing a CIDR IP permission, GroupName, IpProtocol, FromPort, ToPort and CidrIp must be specified. Mixing these two types of parameters is not allowed.
public
| group_name | string (Required) Name of the security group to modify. |
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| CidrIp | string (Required when revoking CIDR IP permission) CIDR IP range to authorize access to when operating on a CIDR IP. |
| FromPort | integer (Required when revoking CIDR IP permission) Bottom of port range to authorize access to when operating on a CIDR IP. This contains the ICMP type if ICMP is being authorized. |
| ToPort | integer (Required when revoking CIDR IP permission) Top of port range to authorize access to when operating on a CIDR IP. This contains the ICMP code if ICMP is being authorized. |
| IpProtocol | string (Required when revoking CIDR IP permission) IP protocol to authorize access to when operating on a CIDR IP. Valid values are ‘tcp’, ‘udp’ and ‘icmp’. |
| SourceSecurityGroupName | string (Required when revoking user/group pair permission) Name of security group to authorize access to when operating on a user/group pair. |
| SourceSecurityGroupOwnerId | string (Required when revoking user/group pair permission) Owner of security group to authorize access to when operating on a user/group pair. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function bundle_instance( $instance_id, $opt = null )
Bundles an Amazon EC2 instance running Windows. For more information, see Bundling an AMI in Windows. This operation is for Windows instances only.
public
| instanceId | string (Required) The ID of the instance to bundle. |
| opt | array (Required) Associative array of parameters which can have the following keys: |
| Bucket | string (Required) The bucket in which to store the AMI. |
| Prefix | string (Required) The prefix to append to the AMI. |
| UploadPolicy | array (Optional) The upload policy gives Amazon EC2 limited permission to upload items into your Amazon S3 bucket. See example for documentation. If an Upload Policy is not provided, this method will generate one from the provided information setting ONLY the required values, and will set an expiration of 12 hours. |
| AWSAccessKeyId | string (Optional) The Access Key ID of the owner of the Amazon S3 bucket. Defaults to the AWS Key used to authenticate the request. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function cancel_bundle_task( $bundle_id, $returnCurlHandle = null )
Cancels an Amazon EC2 bundling operation. For more information on bundling instances, see Bundling an AMI in Windows. This operation is for Windows instances only.
public
| bundle_id | string (Required) The ID of the bundle task to cancel. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object
public function describe_bundle_tasks( $opt = null )
Describes current bundling tasks. For more information on bundling instances, see Bundling an AMI in Windows. This operation is for Windows instances only.
public
| opt | array (Optional) Associative array of parameters which can have the following keys: |
| bundleId | string (Optional) The ID of the bundle task to describe. If no ID is specified, all bundle tasks are described. |
| returnCurlHandle | boolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request. This is useful for MultiCURL requests. |
ResponseCore object