Ec2 CLT
Ec2 CLT
CLI Reference
API Version 2012-06-15
Amazon Elastic Compute Cloud CLI Reference
The following are trademarks or registered trademarks of Amazon: Amazon, Amazon.com, Amazon.com
Design, Amazon DevPay, Amazon EC2, Amazon Web Services Design, AWS, CloudFront, EC2, Elastic
Compute Cloud, Kindle, and Mechanical Turk. In addition, Amazon.com graphics, logos, page headers,
button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other
countries. Amazon's trademarks and trade dress may not be used in connection with any product or service
that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner
that disparages or discredits Amazon.
All other trademarks not owned by Amazon are the property of their respective owners, who may or may
not be affiliated with, connected to, or sponsored by Amazon.
Amazon Elastic Compute Cloud CLI Reference
Welcome ................................................................................................................................................. 1
API Tools Reference ............................................................................................................................... 2
Common Options for API Tools ............................................................................................................... 5
List of API Tools by Function ................................................................................................................... 7
ec2-allocate-address ............................................................................................................................ 13
ec2-assign-private-ip-addresses ........................................................................................................... 17
ec2-associate-address .......................................................................................................................... 21
ec2-associate-dhcp-options .................................................................................................................. 26
ec2-associate-route-table ..................................................................................................................... 30
ec2-attach-internet-gateway ................................................................................................................. 34
ec2-attach-network-interface ................................................................................................................ 37
ec2-attach-volume ................................................................................................................................ 40
ec2-attach-vpn-gateway ........................................................................................................................ 44
ec2-authorize ........................................................................................................................................ 48
ec2-bundle-instance ............................................................................................................................. 55
ec2-cancel-bundle-task ......................................................................................................................... 60
ec2-cancel-conversion-task .................................................................................................................. 63
ec2-cancel-export-task ......................................................................................................................... 67
ec2-cancel-spot-instance-requests ....................................................................................................... 70
ec2-confirm-product-instance ............................................................................................................... 73
ec2-create-customer-gateway .............................................................................................................. 76
ec2-create-dhcp-options ....................................................................................................................... 80
ec2-create-group .................................................................................................................................. 84
ec2-create-image .................................................................................................................................. 88
ec2-create-instance-export-task ........................................................................................................... 92
ec2-create-internet-gateway ................................................................................................................. 96
ec2-create-keypair ................................................................................................................................ 99
ec2-create-network-acl ....................................................................................................................... 103
ec2-create-network-acl-entry .............................................................................................................. 106
ec2-create-network-interface .............................................................................................................. 111
ec2-create-placement-group ............................................................................................................... 116
ec2-create-route ................................................................................................................................. 119
ec2-create-route-table ........................................................................................................................ 123
ec2-create-snapshot ........................................................................................................................... 126
ec2-create-spot-datafeed-subscription ............................................................................................... 130
ec2-create-subnet ............................................................................................................................... 133
ec2-create-tags ................................................................................................................................... 137
ec2-create-volume .............................................................................................................................. 141
ec2-create-vpc .................................................................................................................................... 145
ec2-create-vpn-connection ................................................................................................................. 149
ec2-create-vpn-gateway ..................................................................................................................... 154
ec2-delete-customer-gateway ............................................................................................................. 158
ec2-delete-dhcp-options ..................................................................................................................... 161
ec2-delete-disk-image ........................................................................................................................ 164
ec2-delete-group ................................................................................................................................. 168
ec2-delete-internet-gateway ............................................................................................................... 172
ec2-delete-keypair .............................................................................................................................. 175
ec2-delete-network-acl ....................................................................................................................... 178
ec2-delete-network-acl-entry .............................................................................................................. 181
ec2-delete-network-interface .............................................................................................................. 185
ec2-delete-placement-group ............................................................................................................... 188
ec2-delete-route .................................................................................................................................. 191
ec2-delete-route-table ......................................................................................................................... 194
ec2-delete-snapshot ........................................................................................................................... 197
ec2-delete-spot-datafeed-subscription ............................................................................................... 200
ec2-delete-subnet ............................................................................................................................... 203
ec2-delete-tags ................................................................................................................................... 206
ec2-delete-volume .............................................................................................................................. 210
Welcome
This is the Amazon Elastic Compute Cloud Command Line Reference. It provides the syntax, description,
options, and usage examples for each of the Amazon EC2 API tools and AMI tools. The API tools are
commands that wrap the Amazon EC2 API actions. The AMI tools are commands you install and run on
an instance for the purposes of managing AMIs. Often, these AMI tools are installed with the AMI.
Amazon EC2 is a web service that provides resizeable computing capacity that you use to build and host
your software systems.
Note
This guide also includes the commands for Amazon Virtual Private Cloud (Amazon VPC). For
more information about the service, go to the Amazon Virtual Private Cloud User Guide.
Amazon EC2 API Tools Download the Amazon EC2 API tools.
Amazon EC2 AMI Tools Download the Amazon EC2 AMI tools.
Getting Started with the CLI Instructions for installing the Amazon EC2 API tools.
Commands for AMI Tools (p. 601) Alphabetical list of all Amazon EC2 AMI tools commands.
Commands for API Tools (p. 7) Alphabetical list of all Amazon EC2 API tools commands.
Common Options for AMI Tools (p. 601) Options that all AMI tools commands can use.
Common Options for API Tools (p. 5) Options that all API tools commands can use.
Regions and Endpoints Itemized regions and endpoints for all AWS products.
Topics
• Common Options for API Tools (p. 5)
• List of API Tools by Function (p. 7)
• ec2-allocate-address (p. 13)
• ec2-assign-private-ip-addresses (p. 17)
• ec2-associate-address (p. 21)
• ec2-associate-dhcp-options (p. 26)
• ec2-associate-route-table (p. 30)
• ec2-attach-internet-gateway (p. 34)
• ec2-attach-network-interface (p. 37)
• ec2-attach-volume (p. 40)
• ec2-attach-vpn-gateway (p. 44)
• ec2-authorize (p. 48)
• ec2-bundle-instance (p. 55)
• ec2-cancel-bundle-task (p. 60)
• ec2-cancel-conversion-task (p. 63)
• ec2-cancel-export-task (p. 67)
• ec2-cancel-spot-instance-requests (p. 70)
• ec2-confirm-product-instance (p. 73)
• ec2-create-customer-gateway (p. 76)
• ec2-create-dhcp-options (p. 80)
• ec2-create-group (p. 84)
• ec2-create-image (p. 88)
• ec2-create-instance-export-task (p. 92)
• ec2-create-internet-gateway (p. 96)
• ec2-create-keypair (p. 99)
• ec2-create-network-acl (p. 103)
• ec2-create-network-acl-entry (p. 106)
• ec2-create-network-interface (p. 111)
• ec2-create-placement-group (p. 116)
• ec2-create-route (p. 119)
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
AMIs/Images
Elastic IP Addresses
General
Instances
Key Pairs
Monitoring
Placement Groups
Reserved Instances
Security Groups
Spot Instances
Tags
VM Import
VM Export
Windows
ec2-allocate-address
Description
For EC2 Elastic IP addresses: Acquires an Elastic IP address for use with your AWS account. For more
information about EC2 Elastic IP addresses, see Instance Addressing in the Amazon Elastic Compute
Cloud User Guide.
For VPC addresses: Acquires an Elastic IP address for use with your VPC. For information about VPC
addresses and how they differ from EC2 addresses, see Elastic IP Addresses in the Amazon Virtual
Private Cloud User Guide.
Syntax
ec2-allocate-address [-d domain]
Options
Name Description Required
-d, --domain domain Set to vpc to allocate the address for use with VPC Conditional
instances.
Type: String
Default: Address is standard (allocated to EC2).
Valid values: vpc
Condition: Required when allocating an address for
use with VPC instances.
Example: -d vpc
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example returns an EC2 Elastic IP address for use with the account.
PROMPT> ec2-allocate-address
ADDRESS 192.0.2.1
Example Request
This example returns a VPC Elastic IP address for use with your VPC.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AllocateAddress
Related Commands
• ec2-associate-address (p. 21)
• ec2-describe-addresses (p. 225)
• ec2-disassociate-address (p. 431)
• ec2-release-address (p. 510)
ec2-assign-private-ip-addresses
Description
Assigns one or more secondary private IP addresses to a network interface in Amazon VPC. You can
specify one or more specific secondary IP addresses that you want to assign, or you can specify a number
of secondary IP addresses to be automatically assigned within the subnet’s CIDR block range. The
number of secondary IP addresses that you can assign to an instance varies by instance type. For
information on Amazon EC2 instance types, see Available Instance Types in the Amazon Elastic Compute
Cloud User Guide. For more information about Elastic IP addresses for Amazon VPC, see Elastic IP
Addresses in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-assign-private-ip-addresses --network-interface NetworkInterface
{[--secondary-private-ip-address-count COUNT] | [--secondary-private-ip-address
IP Address]}
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
The command returns true if the operation succeeds or an error if the operation does not succeed.
Examples
Example Request
This example assigns two secondary private IP addresses (10.0.0.118 and 10.0.0.119) to the network
interface eni-c08a35a9.
Example Request
This example assigns two secondary private IP addresses to the network interface eni-c08a35a9. The
IP addresses are automatically assigned from the available IP addresses within the subnet’s CIDR block
range.
Example Request
This example assigns a secondary private IP address of 10.0.0.82 to the network interface eni-73e05a1.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• UnAssignPrivateIpAddresses
ec2-associate-address
Description
This action applies to both Amazon EC2 Elastic IP addresses and Amazon VPC Elastic IP addresses.
For Amazon EC2 addresses: Associates an Elastic IP address with an instance in your AWS account. If
the IP address is currently assigned to another instance, the IP address is assigned to the new instance.
For more information about EC2 Elastic IP addresses, see Instance Addressing in the Amazon Elastic
Compute Cloud User Guide.
For Amazon VPC addresses: This action associates a VPC Elastic IP address with a primary or secondary
private IP address of an instance or a network interface in your VPC. If the Elastic IP address is currently
assigned to another instance or a network interface, Amazon EC2 returns an error unless you specify
the -–allow-reassociation option.
If you do not specify a private IP address, the Elastic IP address is associated with the primary IP address.
For information about VPC addresses and how they differ from EC2 addresses, see Elastic IP Addresses
in the Amazon Virtual Private Cloud User Guide.
This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.
Syntax
ec2-associate-address [-i instance_id | -n network interface] [ip_address | -a
allocation_id] [--private-ip-address] [--allow-reassociation]
Options
Name Description Required
-a, --allocation-id The allocation ID that AWS returned when you Conditional
allocation_id allocated the Elastic IP address to your VPC.
Type: String
Default: None
Condition: Required for VPC Elastic IP addresses.
Example: -a eipalloc-5723d13e
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example associates an EC2 Elastic IP address with an instance.
Example Request
This example associates a VPC Elastic IP address with an instance running in your VPC.
Example Request
This example associates a VPC Elastic IP address with a network interface in your VPC.
Example Request
This example associates an Elastic IP address with a private IP address on the specified instance in a
VPC. The allow-reassociation option allows the Elastic IP address to be associated with the specified
instance, even if it is currently associated with another instance or network interface.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AssociateAddress
Related Commands
• ec2-allocate-address (p. 13)
• ec2-describe-addresses (p. 225)
• ec2-disassociate-address (p. 431)
• ec2-release-address (p. 510)
ec2-associate-dhcp-options
Description
Associates a set of DHCP options (that you've previously created) with the specified VPC. Or, associates
no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch
in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick
up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. If
you want, you can explicitly renew the lease using the operating system on the instance.
For more information about the supported DHCP options and using them with Amazon VPC, see Using
DHCP Options in Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-associate-dhcp-options { dhcp_options_id | default } -c vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example associates the DHCP options with ID dopt-7a8b9c2d with the VPC with ID vpc-1a2b3c4d.
Example Request
This example changes the VPC with ID vpc-1a2b3c4d to use no DHCP options.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AssociateDhcpOptions
Related Commands
• ec2-create-dhcp-options (p. 80)
• ec2-delete-dhcp-options (p. 161)
• ec2-describe-dhcp-options (p. 248)
ec2-associate-route-table
Description
Associates a subnet with a route table. The subnet and route table must be in the same VPC. This
association causes traffic originating from the subnet to be routed according to the routes in the route
table. The action returns an association ID, which you need to disassociate the route table from the subnet
later. A route table can be associated with multiple subnets.
For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User
Guide.
Syntax
ec2-associate-route-table route_table_id -s subnet_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example associates the route-table (with ID rtb-6aa34603) with the subnet with ID subnet-92a045fb.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AssociateRouteTable
Related Commands
• ec2-create-route-table (p. 123)
• ec2-delete-route-table (p. 194)
• ec2-describe-route-tables (p. 345)
• ec2-disassociate-route-table (p. 435)
ec2-attach-internet-gateway
Description
Attaches an Internet gateway to a VPC, enabling connectivity between the Internet and the VPC. For
more information about your VPC and Internet gateway, see the Amazon Virtual Private Cloud User
Guide.
Note
For VPCs that existed before the 2011-01-01 API version: Before you can attach an Internet
gateway, you must delete the legacy security group. For more information, see "Deleting the
Legacy Security Group" in the Security Groups section of the Amazon Virtual Private Cloud User
Guide.
Syntax
ec2-attach-internet-gateway internet_gateway_id -c vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example attaches the Internet gateway with ID igw-eaad4883 to the VPC with ID vpc-11ad4878.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AttachInternetGateway
Related Commands
• ec2-create-internet-gateway (p. 96)
• ec2-delete-internet-gateway (p. 172)
• ec2-describe-internet-gateways (p. 299)
• ec2-detach-internet-gateway (p. 418)
ec2-attach-network-interface
Description
Attaches a network interface to an instance.
Syntax
ec2-attach-network-interface NETWORKINTERFACE -i, --instance INSTANCE -d,
--device-index DEVICEINDEX
Options
Name Description Required
-d, --device-index The index of the device for the network interface Yes
DEVICEINDEX attachment on the instance.
Type: String
Default: None
Example: -d 1 eni-b35da6da
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the ID of the network interface that was attached.
Examples
Example Request
This example attaches the specified network interface to the specified instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AttachNetworkInterface
Related Commands
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-describe-network-interfaces (p. 318)
• ec2-detach-network-interface (p. 421)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
ec2-attach-volume
Description
Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.
For a list of supported device names, see Attaching the Volume to an Instance. Any devices that aren't
reserved for instance store volumes can be attached to an Amazon EBS volume. For more information,
see Amazon EC2 Instance Store.
Note
• The volume can only be attached to the root device of a stopped instance.
• You must be subscribed to the AWS Marketplace code that is on the volume.
• The configuration (instance type, operating system) of the instance must support that specific
AWS Marketplace code. For example, you cannot take a volume from a Windows instance
and attach it to a Linux instance.
• AWS Marketplace product codes are copied from the volume to the instance.
Syntax
ec2-attach-volume volume_id --instance instance_id --device device
Options
Name Description Required
volume_id The ID of the Amazon EBS volume. The volume and Yes
instance must be within the same Availability Zone
and the instance must be running.
Type: String
Default: None
Example: vol-4d826724
-i, --instance The ID of the instance to attach the volume to. The Yes
instance_id volume and instance must be within the same
Availability Zone and the instance must be running.
Type: String
Default: None
Example: -i i-6058a509
-d, --device device Specifies the device name to expose to the instance. Yes
Type: String
Default: None
Example: -d /dev/sdf (for Linux/UNIX) or -d xvdf (for
Windows)
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example attaches volume vol-4d826724 to instance i-6058a509 and exposes it as /dev/sdh.
For information on standard storage locations, see the Amazon Elastic Compute Cloud User Guide.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AttachVolume
Related Commands
• ec2-create-volume (p. 141)
• ec2-delete-volume (p. 210)
• ec2-describe-volumes (p. 396)
• ec2-detach-volume (p. 424)
ec2-attach-vpn-gateway
Description
Attaches a virtual private gateway to a VPC. For more information, see Adding an IPsec Hardware Virtual
Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-attach-vpn-gateway -p vpn_gateway_id -c vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example attaches the virtual private gateway with ID vgw-8db04f81 to the VPC with ID vpc-1a2b3c4d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• AttachVpnGateway
Related Commands
• ec2-create-vpn-gateway (p. 154)
• ec2-describe-vpn-gateways (p. 413)
• ec2-detach-vpn-gateway (p. 428)
• ec2-create-vpc (p. 145)
ec2-authorize
Description
Adds a rule to a security group. The rule can be for ingress traffic, or for egress traffic (only if this is a
VPC security group). For information about VPC security groups and how they differ from EC2 security
groups, see Security Groups in the Amazon Virtual Private Cloud User Guide.
For EC2 security groups and ingress rules: This command either gives one or more CIDR IP address
ranges permission to access a security group in your account, or it gives one or more security groups
(called the source groups) permission to access a security group in your account. A source group can
be in your own AWS account, or another.
For VPC security groups and ingress rules: This command either gives one or more CIDR IP address
ranges permission to access a security group in your VPC, or it gives one or more other security groups
(called the source groups) permission to access a security group in your VPC. The groups must all be in
the same VPC.
For VPC security groups and egress rules: This command permits instances in a VPC security group to
send traffic to either one or more destination CIDR IP address ranges, or to one or more destination
security groups in the same VPC.
Each rule consists of the protocol (e.g., TCP), plus either a CIDR range, or a source group (for ingress
rules) or destination group (for egress rules). For TCP and UDP, you must also specify the destination
port or port ranges. You can specify -1 to mean all ports (i.e., port range 0-65535). For ICMP, you must
also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes.
Permission changes are propagated to instances within the security group as quickly as possible. However,
a small delay might occur.
Important
For EC2 security groups: You can have up to 100 rules per group.
For VPC security groups: You can have up to 50 rules total per group (covering both ingress
and egress).
Syntax
ec2-authorize group [--egress] [-P protocol] (-p port_range | -t icmp_type_code)
[-u source_or_dest_group_owner ...] [-o source_or_dest_group ...] [-s
source_or_dest_cidr ...]
Options
Name Description Required
group For EC2 groups: The name or ID of the security group Yes
to modify.
For VPC groups: The ID of the security group to
modify.
The group must belong to your AWS account.
Type: String
Default: None
Example: websrv
-t icmp_type_code For ICMP: The ICMP type and code. Use the format Conditional
type:code, where both are integers. You can use -1
for the type or code to mean all types or all codes.
Type: String
Default: None
Condition: Required if specifying icmp (or the
equivalent number) for the protocol.
Example: -t -1:-1
-u, The ID of the AWS account that owns the source Conditional
source_or_dest_group security group. If the group is in your own account, set
_owner this to your own AWS account ID. Cannot be used
when specifying a CIDR IP address.
Type: String
Default: None
Condition: For EC2 security groups only. Required
when adding a rule that gives access to one or more
source security groups.
Example: -u 111122223333
-s, --cidr The CIDR range. Cannot be used when specifying a Conditional
source_or_dest_cidr source or destination security group with the -o option.
Type: String
Default: 0.0.0.0/0
Constraints: Valid CIDR IP address range.
Condition: Required if giving access to one or more
IP address ranges.
Example: -s 205.192.8.45/24
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
EC2 security groups: This example grants TCP port 80 access from the 192.0.2.0/24 address range to
the EC2 security group called websrv.
Example Request
EC2 security groups: This example grants TCP port 80 access from the EC2 source group called
OtherAccountGroup (in AWS account 111122223333) to your EC2 security group called websrv.
Example Request
VPC security groups: This example grants TCP port 80 access from the 192.0.2.0/24 address range to
the VPC security group with ID sg-eea7b782.
Example Request
VPC security groups: This example grants egress access from the VPC group sg-eea7b782 to the VPC
destination group sg-80aebeec on TCP destination port 1433.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Actions
• AuthorizeSecurityGroupEgress
• AuthorizeSecurityGroupIngress
Related Commands
• ec2-create-group (p. 84)
• ec2-delete-group (p. 168)
• ec2-describe-group (p. 256)
ec2-bundle-instance
Description
Bundles an Amazon instance store-backed Windows instance.
Note
During bundling, only the root store (C:\) is bundled. Data on instance store volumes is not
preserved.
This procedure is not applicable for Linux and UNIX instances or Windows instances that use
Amazon EBS volumes as their root devices.
Syntax
ec2-bundle-instance instance_id -b bucket -p prefix -o access_key_id {-c policy
| -s policy_signature |-w owner_secret_access_key} [-x hours] [--location
location] [-B]
Options
Name Description Required
-b, --bucket bucket The bucket in which to store the AMI. You can specify Yes
a bucket that you already own or a new bucket that
Amazon EC2 creates on your behalf. If you specify a
bucket that belongs to someone else, Amazon EC2
returns an error.
Type: String
Default: None
Example: -b myawsbucket
-p, --prefix prefix The prefix for the image component names being Yes
stored in Amazon S3.
Type: String
Default: None
Example: -p winami
-o, --owner-akid The Access Key ID of the owner of the Amazon S3 Yes
access_key_id bucket.
Type: String
Default: None
Example: -o AKIAIOSFODNN7EXAMPLE
-w, --owner-sak The AWS Secret Access Key for the owner of the Conditional
owner_secret_access_ Amazon S3 bucket specified in the -b parameter. This
key parameter is required in either of these cases:
-x, --expires hours The validity period, in hours, for a generated upload No
policy.
Type: String
Default: 24
Example:-x 8
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example bundles an instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• BundleInstance
Related Commands
• ec2-cancel-bundle-task (p. 60)
• ec2-create-image (p. 88)
• ec2-describe-bundle-tasks (p. 235)
ec2-cancel-bundle-task
Description
Cancels an Amazon EC2 bundling operation.
Syntax
ec2-cancel-bundle-task bundle_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example cancels the bun-cla322b9 bundle task.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CancelBundleTask
Related Commands
• ec2-bundle-instance (p. 55)
• ec2-describe-bundle-tasks (p. 235)
ec2-cancel-conversion-task
Description
Cancels an active conversion task. The task can be the import of an instance or volume. The command
removes all artifacts of the conversion, including a partially uploaded volume or instance. If the conversion
is complete or is in the process of transferring the final disk image, the command fails and returns an
exception.
For more information, see Using the Command Line Tools to Import Your Virtual Machine to Amazon
EC2 in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-cancel-conversion-task task_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the status (success or failure) of the deletion.
Example
Example Request
This example deletes the conversion identified by task ID import-i-fh95npoc.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CancelConversionTask
Related Commands
• ec2-delete-disk-image (p. 164)
• ec2-describe-conversion-tasks (p. 240)
• ec2-import-instance (p. 451)
ec2-cancel-export-task
Description
Cancels an active export task. The command removes all artifacts of the export, including any partially
created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk
image, the command fails and returns an error.
Syntax
ec2-cancel-export-task task_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the status (success or failure) of the cancellation.
Example
Example Request
This example deletes the export identified by task ID export-i-fgelt0i7.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CancelExportTask
Related Commands
• ec2-create-instance-export-task (p. 92)
• ec2-describe-export-tasks (p. 253)
ec2-cancel-spot-instance-requests
Description
Cancels one or more Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on
your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2
periodically sets the Spot Price based on available Spot Instance capacity and current Spot Instance
requests. For more information about Spot Instances, see Spot Instances in the Amazon Elastic Compute
Cloud User Guide.
Important
Canceling a Spot Instance request does not terminate running Spot Instances associated with
the request.
Syntax
ec2-cancel-spot-instance-requests request_id [request_id...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example cancels a Spot Instance request.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CancelSpotInstanceRequests
Related Commands
• ec2-describe-spot-instance-requests (p. 363)
• ec2-describe-spot-price-history (p. 371)
• ec2-request-spot-instances (p. 533)
ec2-confirm-product-instance
Description
Determines whether a product code is associated with an instance. This command can only be run by
the owner of the product code. It is useful when a product code owner needs to verify whether an EC2
user’s instance is eligible for support.
Syntax
ec2-confirm-product-instance product_code -i instance_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example determines whether the product code is associated with the instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ConfirmProductInstance
Related Commands
• ec2-describe-instances (p. 285)
• ec2-run-instances (p. 568)
ec2-create-customer-gateway
Description
Provides information to AWS about your VPN customer gateway device. The customer gateway is the
appliance at your end of the VPN connection (compared to the virtual private gateway, which is the device
at the AWS side of the VPN connection)
You must provide the Internet-routable IP address of the customer gateway's external interface. The IP
address must be static and can't be behind a device performing network address translation (NAT).
You must also provide the device's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use
a private ASN (in the 64512 - 65534 range).
Note
Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with the exception of
7224, which is reserved in US East, and 9059, which is reserved in EU West.
For more information about Amazon Virtual Private Cloud and VPN customer gateways, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-customer-gateway -t type -i ip_address -b bgp_asn
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example passes information to AWS about the customer gateway with IP address 12.1.2.3 and ASN
65534.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateCustomerGateway
Related Commands
• ec2-delete-customer-gateway (p. 158)
• ec2-describe-customer-gateways (p. 243)
ec2-create-dhcp-options
Description
Creates a set of DHCP options for your VPC. After creating the new set, you must then associate it with
the VPC, causing all existing and new instances that you launch in the VPC to use the new set of DHCP
options. The following table lists the individual DHCP options you can specify. For more information about
the options, see RFC 2132.
domain-name-servers The IP address of a domain name server. You can specify up to four
addresses.
ntp-servers The IP address of a Network Time Protocol (NTP) server. You can specify
up to four addresses.
netbios-name-servers The IP address of a NetBIOS name server. You can specify up to four
addresses.
netbios-node-type The NetBIOS node type (1, 2, 4, or 8). For more information about the values,
see RFC 2132. We recommend you only use 2 at this time (broadcast and
multicast are currently not supported).
Important
Your VPC automatically starts out with a set of DHCP options that includes only a DNS server
that we provide (AmazonProvidedDNS). If you create a new set of options, and if your VPC has
an Internet gateway, make sure to set the domain-name-servers option either to
AmazonProvidedDNS or to a domain name server of your choice.
For more information about Amazon Virtual Private Cloud and DHCP options, see Using DHCP Options
in Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-dhcp-options name=value[,value...] [ name=value[,value...] ... ]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a new set of DHCP options with a domain name mydomain.com and two DNS
servers (10.2.5.1 and 10.2.5.2).
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateDhcpOptions
Related Commands
• ec2-associate-dhcp-options (p. 26)
• ec2-delete-dhcp-options (p. 161)
• ec2-describe-dhcp-options (p. 248)
ec2-create-group
Description
Creates a new security group. You can create either an EC2 security group (which works only with EC2),
or a VPC security group (which works only with Amazon Virtual Private Cloud). The two types of groups
have different capabilities. For information about VPC security groups and how the two types of groups
differ, see Security Groups in the Amazon Virtual Private Cloud User Guide. For information about EC2
security groups, see Using Security Groups in the Amazon Elastic Compute Cloud User Guide.
When you create a security group, you give it a friendly name of your choice. You can have an EC2
security group with the same name as a VPC security group (each group has a unique security group ID
separate from the name). Two EC2 groups can't have the same name, and two VPC groups can't have
the same name.
If you don't specify a security group when you launch an instance, the instance is launched into the default
security group. This group (and only this group) includes a default rule that gives the instances in the
group unrestricted network access to each other. You have a default EC2 security group for instances
you launch with EC2 (i.e., outside a VPC), and a default VPC security group for instances you launch in
your VPC.
You can add or remove rules from your security groups (i.e., authorize or revoke permissions) using
ec2-authorize, and ec2-revoke commands.
For more information about EC2 security groups, see Security Groups in the Amazon Elastic Compute
Cloud User Guide.
Important
Syntax
ec2-create-group group_name -d description [-c vpc_id]
Options
Name Description Required
-d, --description The description of the group. This is informational only. Yes
description Type: String
Default: None
Constraints: Accepts alphanumeric characters, spaces,
dashes, and underscores.
Example: -d "Web servers"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates the websrv security group.
Example Request
This example creates the MyVPCGroup security group in the VPC with ID vpc-3325caf2.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateSecurityGroup
Related Commands
• ec2-authorize (p. 48)
• ec2-delete-group (p. 168)
• ec2-describe-group (p. 256)
• ec2-revoke (p. 562)
• ec2-run-instances (p. 568)
ec2-create-image
Description
Creates an AMI that uses an Amazon EBS root device from a running or stopped instance. For more
information about Amazon EBS-backed AMIs, see Using Amazon EBS-Backed AMIs and Instances.
Note
If you customized your instance with instance store volumes or EBS volumes in addition to the
root device, the new AMI contains block device mapping information for those volumes. When
you then launch an instance from your new AMI, the instance automatically launches with the
additional volumes.
Syntax
ec2-create-image instance_id --name name [--description description]
[--no-reboot]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates an AMI from the i-10a64379 instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateImage
Related Commands
• ec2-describe-instances (p. 285)
• ec2-run-instances (p. 568)
• ec2-terminate-instances (p. 587)
ec2-create-instance-export-task
Description
Exports a running or stopped instance to an Amazon S3 bucket. For information about the supported
operating systems, image formats, and known limitations for the types of instances you can export, see
Exporting EC2 Instances in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-create-instance-export-task instance_id -e target_environment -f
disk_image_format [-c container_format] -b S3_bucket [-p S3_prefix] [-d
description]
Options
Name Description Required
-b, --bucket S3_bucket The name of the destination Amazon S3 bucket Yes
where the file will be exported. The destination
bucket must grant WRITE and READ_ACL
permissions to the
[email protected] AWS account.
Type: String
-p, --prefix S3_prefix The prefix for the Amazon S3 key (object No
name) used for the exported file. Maximum
length is 1000 bytes of UTF-8 character
encoding. The final key is composed from this
prefix (if supplied), the export-task-id, and other
relevant parameters.
Type: String
Example: my-export-,
incoming/vm-export/
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a task to export an instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateInstanceExportTask
Related Commands
• ec2-cancel-export-task (p. 67)
• ec2-describe-export-tasks (p. 253)
ec2-create-internet-gateway
Description
Creates a new Internet gateway for use with a VPC. After creating the Internet gateway, you then attach
it to a VPC using ec2-attach-internet-gateway. For more information about your VPC and Internet
gateway, see the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-internet-gateway
Options
This command does not have any options.
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates an Internet gateway.
PROMPT> ec2-create-internet-gateway
INTERNETGATEWAY igw-c0a643a9
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateInternetGateway
Related Commands
• ec2-attach-internet-gateway (p. 34)
• ec2-delete-internet-gateway (p. 172)
• ec2-describe-internet-gateways (p. 299)
• ec2-detach-internet-gateway (p. 418)
ec2-create-keypair
Description
Creates a new 2048-bit RSA key pair with the specified name. The public key is stored by Amazon EC2
and the private key is displayed on the console. The private key is returned as an unencrypted PEM
encoded PKCS#8 private key. If a key with the specified name already exists, Amazon EC2 returns an
error.
Tip
The key pair returned to you works only in the Region you're using when you create the key pair.
If you'd like to create a key pair that works in all Regions, see ec2-import-keypair (p. 458).
Syntax
ec2-create-keypair key
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a key pair named gsg-keypair.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateKeyPair
Related Commands
• ec2-delete-keypair (p. 175)
• ec2-describe-keypairs (p. 304)
• ec2-run-instances (p. 568)
ec2-create-network-acl
Description
Creates a new network ACL in a VPC. Network ACLs provide an optional layer of security (on top of
security groups) for the instances in your VPC. For more information about network ACLs, see Network
ACLs in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-network-acl vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a new network ACL in the VPC with ID vpc-11ad4878. Notice that the response
includes a default entry for egress, and another for ingress, each with a very high rule number (32767).
These are the last entries that Amazon VPC processes to decide whether traffic is allowed into our out
of an associated subnet. If the traffic doesn't match any rules with a lower rule number, then these default
entries ultimately deny the traffic. The -1 means all protocols and ports.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateNetworkAcl
Related Commands
• ec2-delete-network-acl (p. 178)
• ec2-describe-network-acls (p. 308)
• ec2-replace-network-acl-association (p. 514)
ec2-create-network-acl-entry
Description
Creates an entry (i.e., rule) in a network ACL with a rule number you specify. Each network ACL has a
set of numbered ingress rules and a separate set of numbered egress rules. When determining whether
a packet should be allowed in or out of a subnet, Amazon VPC processes the entries in the ACL according
to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set
of egress rules.
Important
We recommend that you leave room between the rule numbers (e.g., 100, 110, 120, etc.), and
not number them one right after the other (e.g., 101, 102, 103, etc.). This allows you to easily
add a new rule between existing ones without having to renumber the rules.
After you add an entry, you can't modify it; you must either replace it or create a new entry and delete
the old one.
For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User
Guide.
Syntax
ec2-create-network-acl-entry acl_id -n rule_number [--egress] -P protocol -r
cidr [-p port_range] [-t icmp_type_code] { --allow | --deny }
Options
Name Description Required
-n, --rule-number The rule number to assign to the entry (e.g., 100). ACL Yes
rule_number entries are processed in ascending order by rule
number.
Type: Number
Default: None
Constraints: Positive integer from 1 to 32766
Example: -n 100
-P, --protocol The IP protocol. You can specify all or -1 to mean Yes
protocol all protocols.
Type: String
Valid values: all | -1 | tcp | udp | icmp or any
protocol number (for a list, see Protocol Numbers).
Example: -P 6
-r, --cidr cidr The CIDR range to allow or deny, in CIDR notation. Yes
Type: String
Default: None
Example: -r 172.16.0.0/24
-p, --port-range For TCP or UDP: The range of ports to allow. Conditional
port_range Type: String
Default: None
Valid values: A single integer or a range (min-max).
You can specify -1 to mean all ports (i.e. port range
0-65535).
Condition: Required if specifying tcp or udp (or the
equivalent number) for the protocol.
Example: -p 80-84
-t, For ICMP: The ICMP type and code using format Conditional
--icmp-type-code type:code, where both are integers. You can use -1
icmp_type_code for the type or code to mean all types or all codes
Type: String
Default: None
Condition: Required if specifying icmp (or the
equivalent number) for the protocol.
Example: -t -1:-1
--allow Specifies that any traffic matching the rule is allowed. Conditional
Condition: You must specify either --allow or --deny,
but not both options.
--deny Specifies that any traffic matching the rule is denied. Conditional
Condition: You must specify either --allow or --deny,
but not both.
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates an entry with rule number 100 in the network ACL with ID acl-2cb85d45. The rule
allows ingress traffic from anywhere (0.0.0.0/0) on UDP port 53 into the subnet.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateNetworkAclEntry
Related Commands
• ec2-delete-network-acl-entry (p. 181)
• ec2-describe-network-acls (p. 308)
• ec2-replace-network-acl-entry (p. 517)
ec2-create-network-interface
Description
Creates a network interface in the subnet that you specify. This command is only available in Amazon
VPC.
Syntax
ec2-create-network-interface -d, --description DESCRIPTION [--private-ip-address
IP_ADDRESS] [--secondary-private-ip-address IP_ADDRESS]
[--secondary-private-ip-address-count COUNT][-g, --group GROUP] SUBNET
Options
Name Description Required
-g, --group GROUP A security group to add to the network interface. You No
can use this option multiple times to add multiple
groups.
Type: String
Default: None. If no security group is specified, the
interface will become a member of the default security
group.
Example: -g sg-bba1bcd7 –g sg-6d495601
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the ENI ID for the network interface that was created, along with the subnet ID,
VPC ID, Availability Zone, private IP addresses, and security group membership.
Examples
Example Request
This example creates a network interface address in the specified subnet.
Example Request
This example creates a network interface address with a primary private IP address of 10.0.0.117, and
two secondary private IP addresses: one secondary private IP address of 10.0.0.118 and another secondary
private IP address that will be automatically assigned.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateNetworkInterface
Related Commands
• ec2-attach-network-interface (p. 37)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-describe-network-interfaces (p. 318)
• ec2-detach-network-interface (p. 421)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
ec2-create-placement-group
Description
Creates a placement group that you launch cluster instances into.You must give the group a name unique
within the scope of your account. For more information about placement groups and cluster instances,
see Using Cluster Instances in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-create-placement-group placement-group -s strategy
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates the XYZ-cluster group.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreatePlacementGroup
Related Commands
• ec2-delete-placement-group (p. 188)
• ec2-describe-placement-groups (p. 325)
ec2-create-route
Description
Creates a new route in a route table within a VPC. The route's target can be either a gateway attached
to the VPC or a NAT instance in the VPC.
When determining how to route traffic, we use the route with the most specific match. For example, let's
say the traffic is destined for 192.0.2.3, and the route table includes the following two routes:
Both routes apply to the traffic destined for 192.0.2.3. However, the second route in the list covers a
smaller number of IP addresses and is therefore more specific, so we use that route to determine where
to target the traffic.
For more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User
Guide.
Syntax
ec2-create-route route_table_id -r cidr {-g gateway_id | -i instance_id | -n,
--network-interface NETWORKINTERFACE}
Options
Name Description Required
-r, --cidr The CIDR address block used for the Yes
cidr destination match. Routing decisions are based
on the most specific match.
Type: String
Default: None
Example: -r 0.0.0.0/0
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a route in the route table with ID rtb-e4ad488d.The route matches all traffic (0.0.0.0/0)
and routes it to the Internet gateway with ID igw-eaad4883.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateRoute
Related Commands
• ec2-delete-route (p. 191)
• ec2-describe-route-tables (p. 345)
• ec2-replace-route (p. 521)
ec2-create-route-table
Description
Creates a new route table within a VPC. After you create a new route table, you can add routes and
associate the table with a subnet. For more information about route tables, see Route Tables in the
Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-route-table vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a new route table within the VPC with the ID vpc-9ea045f7.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateRouteTable
Related Commands
• ec2-associate-route-table (p. 30)
• ec2-create-route (p. 119)
• ec2-delete-route-table (p. 194)
• ec2-describe-route-tables (p. 345)
• ec2-disassociate-route-table (p. 435)
• ec2-replace-route-table-association (p. 525)
ec2-create-snapshot
Description
Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for
backups, to make identical copies of instance devices, and to save data before shutting down an instance.
For more information about Amazon EBS, see Amazon Elastic Block Store.
When a snapshot is created, any AWS Marketplace product codes from the volume are propagated to
the snapshot.
When taking a snapshot of a file system, we recommend unmounting it first. This ensures the file system
metadata is in a consistent state, that the 'mounted indicator' is cleared, and that all applications using
that file system are stopped and in a consistent state. Some file systems, such as xfs, can freeze and
unfreeze activity so a snapshot can be made without unmounting.
For Linux/UNIX, enter the following command from the command line to unmount the volume.
umount -d device_name
For example:
umount -d /dev/sdh
For Windows, open Disk Management, right-click the volume to unmount, and select Change Drive Letter
and Path. Then, select the mount point to remove and click Remove.
Syntax
ec2-create-snapshot volume_id [-d description]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a snapshot of volume vol-4d826724.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateSnapshot
Related Commands
• ec2-delete-snapshot (p. 197)
• ec2-describe-snapshots (p. 354)
ec2-create-spot-datafeed-subscription
Description
Creates the data feed for Spot Instances, enabling you to view Spot Instance usage logs. You can create
one data feed per account. For more information about Spot Instances, see Spot Instances in the Amazon
Elastic Compute Cloud User Guide.
Syntax
ec2-create-spot-datafeed-subscription --bucket bucket [--prefix prefix]
Options
Name Description Required
-b, --bucket bucket The Amazon S3 bucket in which to store the Spot Yes
Instance datafeed.
Type: String
Default: None
Constraints: Must be a valid bucket associated with
your account.
Example: -b myawsbucket
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates the data feed for the account.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateSpotDatafeedSubscription
Related Commands
• ec2-delete-spot-datafeed-subscription (p. 200)
• ec2-describe-spot-datafeed-subscription (p. 360)
ec2-create-subnet
Description
Creates a subnet in an existing VPC. You can create up to 20 subnets in a VPC. If you add more than
one subnet to a VPC, they're set up in a star topology with a logical router in the middle. If you feel you
need more than 20 subnets, you can request more by going to
http://aws.amazon.com/contact-us/vpc-request/.
When you create each subnet, you provide the VPC ID and the CIDR block you want for the subnet.
Once you create a subnet, you can't change its CIDR block. The subnet's CIDR block can be the same
as the VPC's CIDR block (assuming you want only a single subnet in the VPC), or a subset of the VPC's
CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap.
The smallest subnet (and VPC) you can create uses a /28 netmask (16 IP addresses), and the largest
uses a /16 netmask (65,536 IP addresses).
Important
AWS reserves both the first four and the last IP address in each subnet's CIDR block. They're
not available for use.
Important
If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't
change if you stop and restart the instance (unlike a similar instance launched outside a VPC,
which gets a new IP address when restarted). It's therefore possible to have a subnet with no
running instances (they're all stopped), but no remaining IP addresses available. For more
information about Amazon EBS-backed AMIs, see AMI Basics in the Amazon Elastic Compute
Cloud User Guide.
Syntax
ec2-create-subnet -c vpc_id -i cidr [ -z zone ]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a subnet with CIDR block 10.0.1.0/24 in the VPC with ID vpc-1a2b3c4d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateSubnet
Related Commands
• ec2-delete-subnet (p. 203)
• ec2-describe-subnets (p. 376)
ec2-create-tags
Description
Adds or overwrites one or more tags for the specified resource or resources. Each resource can have a
maximum of 10 tags. Each tag consists of a key and optional value.Tag keys must be unique per resource.
For more information about tags, see Using Tags in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-create-tags resource_id [resource_id ...] --tag key[=value] [--tag
key[=value] ...]
Options
Name Description Required
--tag key or The key and optional value of the tag, separated by Yes
key=value an equals sign (=). If you don't include a value, we set
the value to an empty string.
If you're using the command line tools on a Windows
system, you might need to use quotation marks (i.e.,
"key=value").
Type: String
Default: None
Constraints: Maximum tag key length is 128
characters. Maximum tag value length is 256
characters. Tag keys and values are case sensitive
and accept Unicode characters.
Example: --tag stack=Production
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example adds (or overwrites) two tags for an AMI and an instance. One of the tags is just a key
(webserver), with no value. The other consists of a key (stack) and value (Production). We set the value
of the webserver tag to an empty string.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateTags
Related Commands
• ec2-delete-tags (p. 206)
• ec2-describe-tags (p. 381)
ec2-create-volume
Description
Creates a new Amazon EBS volume that any Amazon EC2 instance in the same Availability Zone can
attach to. Any AWS Marketplace product codes from the snapshot are propagated to the volume. For
more information about Amazon EBS, see Amazon Elastic Block Store.
Note
You must specify an Availability Zone when creating a volume. The volume and the instance to
which it attaches must be in the same Availability Zone.
Syntax
ec2-create-volume [ --size size | --snapshot snapshot [--size size] ]
--availability-zone zone
Options
Name Description Required
--snapshot snapshot The snapshot from which to create the new volume. Conditional
Type: String
Default: None
Condition: Required if you are creating a volume from
a snapshot.
Example: --snapshot snap-78a54011
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a new 20 GiB volume in Availability Zone us-east-1a.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateVolume
Related Commands
• ec2-attach-volume (p. 40)
• ec2-delete-volume (p. 210)
• ec2-describe-availability-zones (p. 231)
• ec2-describe-volumes (p. 396)
• ec2-detach-volume (p. 424)
ec2-create-vpc
Description
Creates a VPC with the CIDR block you specify. The smallest VPC you can create uses a /28 netmask
(16 IP addresses), and the largest uses a /16 netmask (65,536 IP addresses). To help you decide how
big to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.
By default, each instance you launch in the VPC has the default DHCP options that includes only a default
DNS server that we provide (AmazonProvidedDNS).
For more information about Amazon Virtual Private Cloud and DHCP options, see Using DHCP Options
in Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-vpc cidr [tenancy]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a VPC with CIDR block 10.0.0.0/16.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateVpc
Related Commands
• ec2-associate-dhcp-options (p. 26)
• ec2-create-dhcp-options (p. 80)
• ec2-delete-vpc (p. 213)
• ec2-describe-vpcs (p. 402)
ec2-create-vpn-connection
Description
Creates a new VPN connection between an existing virtual private gateway and customer gateway. The
only supported connection type is ipsec.1.
The response includes information that you need to give to your network administrator to configure your
customer gateway. The underlying native format of this information is XML; however, with the
ec2-create-vpn-connection command, you can transform the information into a different format based
on the vendor that makes your customer gateway (e.g., Cisco or Juniper). If you use a vendor other than
Cisco or Juniper, you can set the --format option to generic, and the information is formatted in a
human readable format for your network administrator. If you want to see the native XML, you can specify
xml as the value of the --format option. If you want to write your own stylesheet, you can use the
--stylesheet option to specify that stylesheet and receive the output in your own format. Whereas the
ec2-create-vpn-connection command lets you choose a format for the configuration information, the
corresponding Amazon VPC API operation (CreateVpnConnection) returns only the native XML.
If you decide to shut down your VPN connection for any reason and then create a new one, you must
reconfigure your customer gateway with the new information returned from this call.
For more information about Amazon Virtual Private Cloud and VPN connections, see Adding an IPsec
Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-vpn-connection -t type --customer-gateway customer_gateway_id
--vpn-gateway vpn_gateway_id [{--format format} | {--stylesheet your_stylesheet}]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a VPN connection between the virtual private gateway with ID vgw-8db04f81 and
the customer gateway with ID cgw-b4dc3961. The example specifies that the configuration information
be formatted as needed for a Cisco customer gateway. Because it's a long set of information, we haven't
displayed it here in the response. To see an example of the information returned, see the Amazon Virtual
Private Cloud Network Administrator Guide.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateVpnConnection
Related Commands
• ec2-attach-vpn-gateway (p. 44)
• ec2-create-subnet (p. 133)
• ec2-create-vpc (p. 145)
• ec2-delete-vpn-connection (p. 216)
• ec2-describe-vpn-connections (p. 407)
ec2-create-vpn-gateway
Description
Creates a new virtual private gateway. A virtual private gateway is the VPC-side endpoint for your VPN
connection. You can create a virtual private gateway before creating the VPC itself.
For more information about Amazon Virtual Private Cloud and virtual private gateway, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-create-vpn-gateway -t type
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example creates a virtual private gateway.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• CreateVpnGateway
Related Commands
• ec2-attach-vpn-gateway (p. 44)
• ec2-delete-vpn-gateway (p. 219)
• ec2-describe-vpn-gateways (p. 413)
• ec2-detach-vpn-gateway (p. 428)
ec2-delete-customer-gateway
Description
Deletes a customer gateway. You must delete the VPN connection before deleting the customer gateway.
For more information about Amazon Virtual Private Cloud and VPN customer gateways, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-delete-customer-gateway customer_gateway_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the customer gateway with ID cgw-b4dc3961.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteCustomerGateway
Related Commands
• ec2-create-customer-gateway (p. 76)
• ec2-describe-customer-gateways (p. 243)
ec2-delete-dhcp-options
Description
Deletes a set of DHCP options that you specify. Amazon VPC returns an error if the set of options you
specify is currently associated with a VPC. You can disassociate the set of options by associating either
a new set of options or the default options with the VPC.
For more information about Amazon Virtual Private Cloud and DHCP options sets, see Using DHCP
Options in Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-delete-dhcp-options dhcp_options_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the set of DHCP options with ID dopt-7a8b9c2d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteDhcpOptions
Related Commands
• ec2-associate-dhcp-options (p. 26)
• ec2-create-dhcp-options (p. 80)
• ec2-describe-dhcp-options (p. 248)
ec2-delete-disk-image
Description
Deletes a partially or fully uploaded disk image for conversion from Amazon S3. You can specify either
the conversion task ID, or the URL to the import manifest file in Amazon S3. For more information, see
Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic
Compute Cloud User Guide.
Syntax
ec2-delete-disk-image { -t task_id | -u url } -o owner_access_key_id -w
owner_secret_access_key [--ignore-active-task]
Options
Name Description Required
-t, --task task_id The Task ID of the conversion task that is no longer Conditional
active.
Type: String
Default: None
Condition: Either the task ID or the URL to the
manifest is required.
Example: -t import-i-fh95npoc
-u, --manifest-url The URL for an existing import manifest file. Use this Conditional
url option to delete the uploaded disk image even if one
or more active conversion tasks still reference the
manifest.
Type: String
Default: None
Condition: Either the task ID or the URL to the
manifest is required.
Example: -u
http://some-s3-location/mydisk-to-delete.vmdk
-o, --owner-akid The access Key ID of the owner of the bucket Yes
owner_access_key_id containing the uploaded disk image to be deleted.
This parameter value is not sent to Amazon EC2.
Type: String
Default: None
Example: -o AKIAIOSFODNN7EXAMPLE
-w, --owner-sak The AWS Secret Access Key of the owner of the Yes
owner_secret_access_ bucket containing the uploaded disk image to be
key deleted. This parameter value is not sent to Amazon
EC2.
Type: String
Default: None
Example: -w
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• Task ID
Examples
Example Request
This example deletes the import-i-fh95npoc disk image.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Commands
• ec2-cancel-conversion-task (p. 63)
• ec2-import-instance (p. 451)
• ec2-import-volume (p. 462)
• ec2-resume-import (p. 557)
ec2-delete-group
Description
Deletes a security group. This action applies to both EC2 security groups and VPC security groups. For
information about VPC security groups and how they differ from EC2 security groups, see Security Groups
in the Amazon Virtual Private Cloud User Guide.
Note
If you attempt to delete a security group that contains instances, or attempt to delete a security
group that is referenced by another security group, an error 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 rule is removed.
The fault returned is InvalidGroup.InUse for EC2 security groups, or DependencyViolation
for VPC security groups.
Syntax
ec2-delete-group { group_name | group_id }
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the EC2 security group called webserv.
Example Request
This example deletes the VPC security group with ID sg-43eeba92.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteSecurityGroup
Related Commands
• ec2-authorize (p. 48)
• ec2-create-group (p. 84)
• ec2-describe-group (p. 256)
• ec2-revoke (p. 562)
ec2-delete-internet-gateway
Description
Deletes an Internet gateway from your AWS account. The gateway must not be attached to a VPC. For
more information about your VPC and Internet gateway, see the Amazon Virtual Private Cloud User
Guide.
Syntax
ec2-delete-internet-gateway internet_gateway_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the Internet gateway with ID igw-eaad4883.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteInternetGateway
Related Commands
• ec2-attach-internet-gateway (p. 34)
• ec2-create-internet-gateway (p. 96)
• ec2-describe-internet-gateways (p. 299)
• ec2-detach-internet-gateway (p. 418)
ec2-delete-keypair
Description
Deletes the specified key pair, by removing the public key from Amazon EC2. You must own the key pair.
Syntax
ec2-delete-keypair key_pair
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the gsg-keypair key pair.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteKeyPair
Related Commands
• ec2-create-keypair (p. 99)
• ec2-describe-keypairs (p. 304)
ec2-delete-network-acl
Description
Deletes a network ACL from a VPC. The ACL must not be associated with any subnets. You can't delete
the default network ACL. For more information about network ACLs, see Network ACLs in the Amazon
Virtual Private Cloud User Guide.
Syntax
ec2-delete-network-acl acl_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the network ACL with ID acl-2cb85d45.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteNetworkAcl
Related Commands
• ec2-create-network-acl (p. 103)
• ec2-describe-network-acls (p. 308)
• ec2-replace-network-acl-association (p. 514)
ec2-delete-network-acl-entry
Description
Deletes an ingress or egress entry (i.e., rule) from a network ACL. For more information about network
ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-delete-network-acl-entry acl_id -n rule_number [--egress]
Options
Name Description Required
-n, --rule-number The rule number for the entry to delete. Yes
rule_number Type: Number
Default: None
Example: 100
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the ingress entry with rule number 100 from the network ACL with ID acl-2cb85d45.
Example Request
This example deletes the egress entry with rule number 200 from the network ACL with ID acl-2cb85d45.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteNetworkAclEntry
Related Commands
• ec2-create-network-acl-entry (p. 106)
• ec2-describe-network-acls (p. 308)
• ec2-replace-network-acl-entry (p. 517)
ec2-delete-network-interface
Description
Deletes a network interface. Network interfaces must be detached from an instance before they can be
deleted.
Syntax
ec2-delete-network-interface NETWORKINTERFACE
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the ID of the network interface that you deleted.
Examples
Example Request
This example deletes the specified network interface.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteNetworkInterface
Related Commands
• ec2-attach-network-interface (p. 37)
• ec2-create-network-interface (p. 111)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-describe-network-interfaces (p. 318)
• ec2-detach-network-interface (p. 421)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
ec2-delete-placement-group
Description
Deletes a placement group in your account.You must terminate all instances in a placement group before
deleting it. For more information about placement groups and cluster instances, see Using Cluster
Instances in the Amazon Elastic Compute Cloud User Guide.
ec2-delete-placement-group placement-group
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
Examples
Example Request
This example deletes the XYZ-cluster placement group.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeletePlacementGroup
Related Commands
• ec2-create-placement-group (p. 116)
• ec2-describe-placement-groups (p. 325)
ec2-delete-route
Description
Deletes a route from a route table in a VPC. For more information about route tables, see Route Tables
in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-delete-route route_table_id -r cidr
Options
Name Description Required
-r, --cidr The CIDR range for the route. The value you Yes
cidr specify must match the CIDR for the route
exactly.
Type: String
Default: None
Example: 0.0.0.0/0
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example removes the route with destination CIDR 172.16.1.0/24 from the route table with ID
rtb-e4ad488d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteRoute
Related Commands
• ec2-create-route (p. 119)
• ec2-describe-route-tables (p. 345)
• ec2-replace-route (p. 521)
ec2-delete-route-table
Description
Deletes a route table from a VPC. The route table must not be associated with a subnet. You can't delete
the main route table. For more information about route tables, see Route Tables in the Amazon Virtual
Private Cloud User Guide.
Syntax
ec2-delete-route-table route_table_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the route table with ID rtb-7aa34613.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteRouteTable
Related Commands
• ec2-associate-route-table (p. 30)
• ec2-create-route-table (p. 123)
• ec2-describe-route-tables (p. 345)
• ec2-disassociate-route-table (p. 435)
• ec2-replace-route-table-association (p. 525)
ec2-delete-snapshot
Description
Deletes a snapshot of an Amazon EBS volume.
Note
If you make periodic snapshots of a volume, the snapshots are incremental so that only the
blocks on the device that have changed since your last snapshot are incrementally saved in the
new snapshot. Even though snapshots are saved incrementally, the snapshot deletion process
is designed so that you need to retain only the most recent snapshot in order to restore the
volume.
Syntax
ec2-delete-snapshot snapshot_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes snapshot snap-78a54011.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteSnapshot
Related Commands
• ec2-create-snapshot (p. 126)
• ec2-describe-snapshots (p. 354)
ec2-delete-spot-datafeed-subscription
Description
Deletes the data feed for Spot Instances. For more information about Spot Instances, see Spot Instances
in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-delete-spot-datafeed-subscription
Options
This command does not have any options.
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns no output.
Examples
Example Request
This example deletes the data feed for the account.
PROMPT> ec2-delete-spot-datafeed-subscription
-
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteSpotDatafeedSubscription
Related Commands
• ec2-create-spot-datafeed-subscription (p. 130)
• ec2-describe-spot-datafeed-subscription (p. 360)
ec2-delete-subnet
Description
Deletes a subnet from a VPC. You must terminate all running instances in the subnet before deleting it,
otherwise Amazon VPC returns an error.
Syntax
ec2-delete-subnet subnet_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the subnet with ID subnet-9d4a7b6c.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteSubnet
Related Commands
• ec2-create-subnet (p. 133)
• ec2-describe-subnets (p. 376)
ec2-delete-tags
Description
Deletes a specific set of tags from a specific set of resources. This command is designed to follow a
ec2-describe-tags command. First determine what tags a resource has, then call ec2-delete-tags
with the resource ID and the specific tags you want to delete.
For more information about tags, see Using Tags in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-delete-tags resource_id [resource_id ... ] --tag key[=value] [--tag
key[=value ...]
Options
Name Description Required
--tag key or The key and optional value of the tag, separated by Yes
key=value an equals sign (=).You can specify more than one tag
to remove.
Type: String
Default: None
Example: --tag stack=Production
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns no output if the deletion is successful.
Examples
Example Request
This example deletes the tags for the AMI with ID ami-1a2b3c4d. You first get a list of the tags.
Then you delete the tags. Specifying the value for the stack tag is optional.
If you specify a value for the key, the tag is deleted only if the tag's value matches the one you specified.
If you specify the empty string as the value, the tag is deleted only if the tag's value is the empty string.
The following example specifies the empty string as the value for the tag to delete (notice the equals sign
after Owner).
Example Request
This example deletes the stack tag from two particular instances.
Example Request
You can specify a tag key without a corresponding tag value if you want to delete the tag regardless of
its value. This example deletes all tags for the specified resources where key=Purpose, regardless of the
tag value.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteTags
Related Commands
• ec2-create-tags (p. 137)
• ec2-describe-tags (p. 381)
ec2-delete-volume
Description
Deletes an Amazon EBS volume. The volume must be in the available state (not attached to an
instance). For more information about Amazon EBS, see Amazon Elastic Block Store in the Amazon
Elastic Compute Cloud User Guide.
Note
The volume remains in the deleting state for several minutes after you run this command.
Syntax
ec2-delete-volume volume_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes volume vol-4282672b.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteVolume
Related Commands
• ec2-attach-volume (p. 40)
• ec2-create-volume (p. 141)
• ec2-describe-volumes (p. 396)
• ec2-detach-volume (p. 424)
ec2-delete-vpc
Description
Deletes a VPC. You must detach or delete all gateways or other objects that are dependent on the VPC
first. For example, you must terminate all running instances, delete all VPC security groups (except the
default), delete all route tables (except the default), and so on.
Syntax
ec2-delete-vpc vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the VPC with ID vpc-1a2b3c4d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteVpc
Related Commands
• ec2-create-vpc (p. 145)
• ec2-describe-vpcs (p. 402)
ec2-delete-vpn-connection
Description
Deletes a VPN connection. Use this command to delete a VPC and its associated components. Another
reason to use this command is if you believe that the tunnel credentials for your VPN connection have
been compromised. In that situation, you can delete the VPN connection and create a new one that has
new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN
connection, you must reconfigure the customer gateway using the new configuration information returned
with the new VPN connection ID.
If you're deleting the VPC and its associated components, we recommend that you detach the virtual
private gateway from the VPC and delete the VPC before deleting the VPN connection.
For more information about Amazon Virtual Private Cloud and VPN connections, see Adding an IPsec
Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-delete-vpn-connection vpn_connection_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the VPN connection with ID vpn-44a8938f.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteVpnConnection
Related Commands
• ec2-create-vpn-connection (p. 149)
• ec2-delete-vpc (p. 213)
• ec2-describe-vpn-connections (p. 407)
• ec2-detach-vpn-gateway (p. 428)
ec2-delete-vpn-gateway
Description
Deletes a virtual private gateway. Use this command to delete a VPC and its associated components
because you no longer need them. We recommend that before you delete a virtual private gateway, you
detach it from the VPC and delete the VPN connection. Note that you don't need to delete the virtual
private gateway if you just want to delete and recreate the VPN connection between your VPC and data
center.
For more information about Amazon Virtual Private Cloud and virtual private gateways, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-delete-vpn-gateway vpn_gateway_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deletes the virtual private gateway with ID vgw-8db04f81.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeleteVpnGateway
Related Commands
• ec2-create-vpn-gateway (p. 154)
• ec2-delete-vpn-connection (p. 216)
• ec2-describe-vpn-gateways (p. 413)
ec2-deregister
Description
Deregisters the specified AMI. After you deregister an AMI, it can't be used to launch new instances.
Note
Syntax
ec2-deregister ami_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example deregisters the ami-4fa54026 AMI.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DeregisterImage
Related Commands
• ec2-describe-images (p. 266)
• ec2-register (p. 504)
ec2-describe-addresses
Description
Lists and describes the Elastic IP addresses allocated to your account. This includes both EC2 and VPC
Elastic IP addresses. For information about VPC addresses and how they differ from EC2 addresses,
see Elastic IP Addresses in the Amazon Virtual Private Cloud User Guide.
You can filter the results to return information only about Elastic IP addresses that match criteria you
specify. For example, you could get information only about addresses tagged with a certain value. You
can specify multiple values for a filter. An address must match at least one of the specified values for it
to be included in the results.
You can specify multiple filters (e.g., the address is a particular value, and is tagged with a certain value).
The result includes information for an address only if it matches all your filters. If there's no match, no
special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
network-interface-id The network interface (if any) that the address is associated with. (for VPC
addresses only).
Type: String
private-ip-address The private IP address associated with the Elastic IP address (for VPC
addresses only).
Type: String
Syntax
ec2-describe-addresses [public_ip ... | allocation_id ...] [[--filter name=value]
...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all addresses you own, or only
those otherwise specified.
Example: --filter "instance-id=i-1a2b3c4d"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the EC2 address 192.0.2.1, which is assigned to instance i-f15ebb98.
Example Request
This example describes the VPC address with allocation ID eipalloc-282d9641, which is assigned to
instance i-7a00642.
Example Request
This example describes all your Elastic IP addresses (both EC2 and VPC).
PROMPT> ec2-describe-addresses
ADDRESS 203.0.113.12 i-f15ebb98 standard
ADDRESS 203.0.113.22 i-9e9da4e9 vpc eipalloc-9258a4fb eipassoc-
0659a56f
ADDRESS 203.0.113.32 vpc eipalloc-9558a4fc
Example Request
This example describes only your VPC Elastic IP addresses.
Example Request
This example describes VPC addresses associated with a particular private IP address.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeAddresses
Related Commands
• ec2-allocate-address (p. 13)
ec2-describe-availability-zones
Description
Displays the Availability Zones that are currently available to the account. The results include zones only
for the Region you're currently using.
Note
Availability Zones are not the same across accounts. The Availability Zone us-east-1a for account
A is not necessarily the same as us-east-1a for account B. Availability Zone assignments are
mapped independently for each account.
You can filter the results to return information only about zones that match criteria you specify. For
example, you could filter the results to return only the zones whose state is available. You can specify
multiple filters (e.g., the zone is in a particular Region, and the state is available). The result includes
information for a particular zone only if it matches all your filters. If there's no match, no special message
is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-availability-zones [zone_name ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Shows all zones in the Region, or only the
ones you've otherwise specified.
Example: --filter "region-name=ap-southeast-1"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example displays information about Availability Zones that are available to the account. The results
include zones only for the Region you're currently using.
PROMPT> ec2-describe-availability-zones
AVAILABILITYZONE us-east-1a available
AVAILABILITYZONE us-east-1b available
AVAILABILITYZONE us-east-1c available
AVAILABILITYZONE us-east-1d available
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeAvailabilityZones
Related Commands
• ec2-describe-regions (p. 329)
• ec2-run-instances (p. 568)
ec2-describe-bundle-tasks
Description
Describes the current bundling tasks.
Note
Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the
list, you can still register an AMI from it. Just use the ec2-register command with the Amazon
S3 bucket name and image manifest name you provided to the bundle task.
You can filter the results to return information only about tasks that match criteria you specify. For example,
you could filter the results to return only the tasks whose state is complete. You can specify multiple
values for a filter. A bundle task must match at least one of the specified values for it to be included in
the results.
You can specify multiple filters (e.g., the bundle is stored in a particular Amazon S3 bucket and the state
is complete). The result includes information for a particular bundle task only if it matches all your filters.
If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
update-time The time of the most recent update for the task, e.g.,
2008-09-15T17:15:20.000Z.
Type: DateTime
Syntax
ec2-describe-bundle-tasks [bundle ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all your bundle tasks, or only those
otherwise specified.
Example: --filter "state=pending"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the status of the bun-c1a540a8 bundle task.
Example Request
This example filters the results to display only bundle tasks whose state is either complete or failed,
and in addition are targeted for the Amazon S3 bucket called myawsbucket.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeBundleTasks
Related Commands
• ec2-bundle-instance (p. 55)
• ec2-cancel-bundle-task (p. 60)
ec2-describe-conversion-tasks
Description
Lists and describes your conversion tasks. For more information, see Using the Command Line Tools to
Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-describe-conversion-tasks [task_id ...] [--show-transfer-details]
Options
Name Description Required
task_id The conversion task ID for the upload. If not specified, all of your No
conversion tasks are returned.
Type: String
Default: None
Example: import-i-ffvko9js
--show-transfer-deta Displays additional details for uploading the disk image. The No
ils ec2-upload-disk-image command automatically returns this
information.
Type: None
Default: None
Example: --show-transfer-details
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
• Information about the task, such as the task ID, task type, expiration, status, and number of bytes
received
• Information about the image, such as the image size, format, volume ID, and volume size
Example
Example Request
This example shows the status of your import instance task.
PROMPT>ec2-describe-conversion-tasks import-i-ffvko9js
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeConversionTasks
Related Commands
• ec2-cancel-conversion-task (p. 63)
• ec2-delete-disk-image (p. 164)
• ec2-import-instance (p. 451)
• ec2-import-volume (p. 462)
• ec2-resume-import (p. 557)
ec2-describe-customer-gateways
Description
Describes your customer gateways. You can filter the results to return information only about customer
gateways that match criteria you specify. For example, you could get information only about gateways
whose state is pending or available. The customer gateway must match at least one of the specified
values for it to be included in the results.
You can specify multiple filters (e.g., the customer gateway has a particular IP address for the
Internet-routable external interface, and the gateway's state is pending or available). The result
includes information for a particular customer gateway only if the gateway matches all your filters. If there's
no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
bgp-asn The customer gateway's Border Gateway Protocol (BGP) Autonomous System
Number (ASN).
Type: String
type The type of customer gateway. Currently the only supported type is ipsec.1.
Type: String
Valid values: ipsec.1
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
For more information about Amazon Virtual Private Cloud and VPN customer gateways, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-describe-customer-gateways [ customer_gateway_id ... ] [[--filter
name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all customer gateways you
own, or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example gives a description of the customer gateway with ID cgw-b4dc3961.
Example Request
This example uses filters to give a description of any customer gateway you own whose IP address is
12.1.2.3, and whose state is either pending or available.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeCustomerGateways
Related Commands
• ec2-create-customer-gateway (p. 76)
• ec2-delete-customer-gateway (p. 158)
ec2-describe-dhcp-options
Description
Describes one or more sets of DHCP options. You can specify one or more DHCP options set IDs, or no
IDs (to describe all your sets of DHCP options).
You can filter the results to return information only about sets of options that match criteria you specify.
For example, you could get information for sets that have a certain value for the domain-name option.
You can specify multiple values for the filter. The option must match at least one of the specified values
for the options set to be included in the results.
You can specify multiple filters (e.g., a certain value for domain-name, and a tag with a certain value).
The result includes information for a set of options only if the specified option matches all your filters. If
there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
For more information about Amazon Virtual Private Cloud and DHCP options sets, see Using DHCP
Options in Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-describe-dhcp-options [ dhcp_options_id ... ] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all DHCP options set you
own, or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example gives a description of the DHCP options set with ID dopt-7a8b9c2d.
Example Request
This example uses filters to give a description of any DHCP options set that includes a domain-name
option whose value includes the string example.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeDhcpOptions
Related Commands
• ec2-associate-dhcp-options (p. 26)
• ec2-create-dhcp-options (p. 80)
• ec2-delete-dhcp-options (p. 161)
ec2-describe-export-tasks
Description
Lists and describes your export tasks, including the most recent canceled and completed tasks.
Syntax
ec2-describe-export-tasks [ task_id ... ] [[--filter name=value] ...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns information about the export task including:
Examples
Example Request
This example describes the export task with the ID export-i-fgelt0i7.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeExportTasks
Related Commands
• ec2-cancel-export-task (p. 67)
• ec2-create-instance-export-task (p. 92)
ec2-describe-group
Description
Describes the security groups in your account. This includes both EC2 security groups and VPC security
groups. For information about how the two types of groups differ, see Security Groups in the Amazon
Virtual Private Cloud User Guide.
You can filter the results to return information only about security groups that match criteria you specify.
For example, you could get information about groups whose name contains a particular string. You can
specify multiple values for a filter. A security group must match at least one of the specified values for it
to be included in the results.
You can specify multiple filters (e.g., the group's name contains a particular string, and the group gives
permission to another security group with a different string in its name). The result includes information
for a particular group only if it matches all your filters. If there's no match, no special message is returned;
the response is simply empty.
Important
Filters are based on literal strings only. This is important to remember when you want to use
filters to return only security groups with access allowed on a specific port number or numbers.
For example, let's say you want to get all groups that have access on port 22. And let's say
GroupA gives access on a range of ports using fromPort=20 and toPort=30. If you filter with
ip-permission.from-port=22 or ip-permission.to-port=22 (or both), GroupA is not
returned in the results. It is only returned in the results if you specify
ip-permission.from-port=20 or ip-permission.to-port=30 (or both).
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
ip-permission.from-port The start of port range for the TCP and UDP
protocols, or an ICMP type number.
Type: String
ip-permission.to-port The end of port range for the TCP and UDP
protocols, or an ICMP code.
Type: String
Syntax
ec2-describe-group [ec2_group_name_or_id | vpc_group_id ...] [[--filter
name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all security groups you own, or only
those otherwise specified.
Example: --filter "group-name=*webserver*"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example returns information about a specific EC2 security group called StandardGroup.
Example Request
This example returns information about a specific VPC security group with ID sg-eea7b782.
Example Request
This example returns information about all security groups that grant access over TCP specifically on
port 22 from instances in either the app_server_group or database_group.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSecurityGroups
Related Commands
• ec2-authorize (p. 48)
• ec2-create-group (p. 84)
• ec2-delete-group (p. 168)
• ec2-revoke (p. 562)
ec2-describe-image-attribute
Description
Describes the specified attribute of an AMI. You can get information about only one attribute at a time.
Syntax
ec2-describe-image-attribute ami_id {-l | -p | -B | --kernel | --ramdisk}
Options
Name Description Required
-p, --product-codes Describes the product codes associated with the AMI. No
Each product code contains both a product code and
a type.
Type: String
Default: None
Example: -p
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example lists the launch permissions for the ami-2bb65342 AMI
Example Request
This example lists the product code for the ami-3bb65342 AMI.
Example Request
This example describes the RAM disk for the ami-d5ed03bc AMI, with the --show-empty-fields
option.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeImageAttribute
Related Commands
• ec2-describe-images (p. 266)
• ec2-modify-image-attribute (p. 473)
• ec2-reset-image-attribute (p. 542)
ec2-describe-images
Description
Describes the images available to you, including public images, private images that you own, and private
images owned by other AWS accounts but for which you have explicit launch permissions.
Launch Description
Permission
public The owner of the AMI granted launch permissions for the AMI to the all group.
All AWS accounts have launch permissions for these AMIs.
explicit The owner of the AMI granted launch permissions to a specific AWS account.
implicit An AWS account has implicit launch permissions for all the AMIs it owns.
The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or AWS accounts with
launch permissions. If no options are specified, Amazon EC2 returns all AMIs for which you have 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, an error is returned. If you specify an AMI ID for which you do not have access, it is not
included in the returned results.
If you specify one or more AMI owners, only AMIs from the specified owners and to which you have
access are returned. The results can include the account IDs of the specified owners—amazon for AMIs
owned by Amazon, aws-marketplace for AMIs owned by AWS Marketplace, or self for AMIs that you
own.
Note
If you specify a list of users with launch permissions, only AMIs with launch permissions for those users
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.
Note
Deregistered images are included in the returned results for an unspecified interval after
deregistration.
You can filter the results to return information only about images that match criteria you specify. For
example, you could get information only about images that use a certain kernel. You can specify multiple
values for a filter (e.g., the image uses either kernel aki-1a2b3c4d or kernel aki-9b8c7d6f). An image
must match at least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the image uses a certain kernel, and uses an Amazon EBS volume
as the root device). The result includes information for a particular image only if it matches all your filters.
If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-images [ami_id ...] [-a] [-o owner ...] [-x user_id ...] [[--filter
name=value] ...]
Options
Name Description Required
-o, --owner owner Describes AMIs owned by the specified owner. Multiple No
owner options can be specified. The IDs amazon,
aws-marketplace, and self can be used to include
AMIs owned by Amazon, AMIs owned by AWS
Marketplace, or AMIs owned by you, respectively.
Type: String
Default: None
Valid values: amazon | aws-marketplace | self |
AWS account ID | all
Example: -o self
-x, --executable-by Describes AMIs for which the specified user ID has No
user_id explicit launch permissions. The user ID can be an
AWS 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.
Type: String
Default: None
Valid values: all | self | AWS account ID
Example: -x self
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: None
Example: --filter "tag-value=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the ami-be3adfd7 AMI.
Example Request
This example filters the results to display only the public Windows images with an x86_64 architecture.
Example Request
This example filters the results to display only images with an AWS Marketplace product code.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeImages
Related Commands
• ec2-describe-image-attribute (p. 262)
• ec2-describe-instances (p. 285)
ec2-describe-instance-attribute
Description
Describes the specified attribute of an instance. You can specify only one attribute at a time.
Syntax
ec2-describe-instance-attribute instance_id { --block-device-mapping |
--disable-api-termination | --group-id | --instance-initiated-shutdown-behavior
| --instance-type | --kernel | --product-codes | --ramdisk | --root-device-name
| | --source-dest-check | --user-data }
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example lists the kernel ID of the i-10a64379 instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeInstanceAttribute
Related Commands
• ec2-describe-instances (p. 285)
• ec2-modify-instance-attribute (p. 478)
• ec2-reset-instance-attribute (p. 545)
ec2-describe-instance-status
Description
Describes the status of an Amazon EC2 instance. Instance status has two main components:
• System Status reports impaired functionality that stems from issues related to the systems that support
an instance, such as such as hardware failures and network connectivity problems. The
DescribeInstanceStatus response elements report such problems as impaired reachability.
• Instance Status reports impaired functionality that arises from problems internal to the instance. The
DescribeInstanceStatus response elements report such problems as impaired reachability.
Instance status provides information about the types of scheduled events for an instance that may require
your attention:
• Scheduled Reboot: When Amazon EC2 determines that an instance must be rebooted, the instance’s
status will return one of two event codes: system-reboot or instance-reboot. System reboot
commonly occurs if certain maintenance or upgrade operations require a reboot of the underlying host
that supports an instance. Instance reboot commonly occurs if the instance must be rebooted, rather
than the underlying host. Rebooting events include a scheduled start and end time.
• Scheduled System Maintenance: When Amazon EC2 determines that an instance requires maintenance
which requires power or network impact, the instance’s status will return an event code called
system-maintenance. System-maintenance is either network maintenance or power maintenance.
For network maintenance, your instance will experience a brief loss of network connectivity. For power
maintenance, your instance will be unavailable for a brief period and then rebooted. System maintenance
events include a scheduled start and end time.You will also be notified by email if one of your instances
is set for system maintenance. The email message indicates when your instance is scheduled for
maintenance.
• Scheduled Retirement: When Amazon EC2 determines that an instance must be shut down, the
instance’s status will return an event code called instance-retirement. Retirement commonly
occurs when the underlying host is degraded and must be replaced. Retirement events include a
scheduled start and end time.You will also be notified by email if one of your instances is set to retiring.
The email message indicates when your instance will be permanently retired.
When your instance is retired, it is either terminated (if its root device type is the instance-store) or stopped
(if its root device type is an EBS volume). Instances stopped due to retirement aren't automatically
restarted, but you can do so manually.You can also avoid retirement of EBS-backed instances by manually
restarting your instance when its event code is instance-retirement. This ensures that your instance
is started on a different underlying host.
You can filter the results to return information only about instances that match criteria you specify. For
example, you could get information about instances in a specific Availability Zone.You can specify multiple
values for a filter (e.g., more than one Availability Zone). An instance must match at least one of the
specified values for it to be included in the results.
You can specify multiple filters (e.g., the instance is in a specific Availability Zone and its status is set to
retiring). An instance must match all the filters for it to be included in the results. If there's no match,
no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-instance-status [instance_id ...] [-I, --hide-healthy ...] [-A,
--include-all-instances ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all instances you own or those you
specify by ID.
Example: --filter "system-status.status=impaired"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the current state of the instances owned by your AWS account.
PROMPT> ec2-describe-instance-status
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeInstanceStatus
Related Commands
• ec2-report-instance-status (p. 529)
ec2-describe-instances
Description
Lists and describes the instances that you own.
If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do
not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an
invalid instance ID, an error is returned. If you specify an instance that you do not own, it will not be
included in the returned results.
Recently terminated instances might appear in the returned results. This interval is usually less than one
hour.
You can filter the results to return information only about instances that match criteria you specify. For
example, you could get information about only instances launched with a certain key pair.You can specify
multiple values for a filter (e.g., the instance was launched with either key pair A or key pair B). An instance
must match at least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the instance was launched with a certain key pair and uses an
Amazon EBS volume as the root device). An instance must match all the filters for it to be included in the
results. If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
key-name The name of the key pair used when the instance
was launched.
Type: String
root-device-name The name of the root device for the instance (e.g.,
/dev/sda1).
Type: String
Syntax
ec2-describe-instances [instance_id ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all instances you own or those you
specify by ID.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the current state of the instances owned by your AWS account.
PROMPT> ec2-describe-instances
Example Request
This example filters the results to display only the m1.small or m1.large instances that have an Amazon
EBS volume that is both attached and set to delete on termination.
Example Request
This example describes all instances that are running only in Amazon VPC.
Example Request
This example describes any instances with a network interface that have a private IP address of 10.0.0.120.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeInstances
Related Commands
• ec2-run-instances (p. 568)
• ec2-start-instances (p. 579)
• ec2-stop-instances (p. 583)
• ec2-terminate-instances (p. 587)
ec2-describe-internet-gateways
Description
Describes your Internet gateways. You can filter the results to return information only about Internet
gateways that match criteria you specify. For example, you could get information only about gateways
with particular tags. The Internet gateway must match at least one of the specified values for it to be
included in the results.
You can specify multiple filters (e.g., the Internet gateway is attached to a particular VPC and is tagged
with a particular value). The result includes information for a particular Internet gateway only if the gateway
matches all your filters. If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
attachment.state The current state of the attachment between the gateway and the VPC.
Returned only if a VPC is attached.
Type: String
Valid value: available
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
For more information about Amazon Virtual Private Cloud and Internet gateways, see the Amazon Virtual
Private Cloud User Guide.
Syntax
ec2-describe-internet-gateways [internet_gateway_id ...] [[--filter name=value]
...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all Internet gateways you own or
those you specify by ID.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes your Internet gateways.
PROMPT> ec2-describe-internet-gateways
INTERNETGATEWAY igw-dfa045b6
ATTACHMENT vpc-d9a045b0 available
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeInternetGateways
Related Commands
• ec2-detach-internet-gateway (p. 34)
ec2-describe-keypairs
Description
Describes the key pairs available to you. If you specify key pairs, information about those key pairs is
returned. Otherwise, information for all your key pairs is returned.
You can filter the results to return information only about key pairs that match criteria you specify. For
example, you could filter the results to return only the key pairs whose names include the string Dave.
You can specify multiple values for a filter. A key pair must match at least one of the specified values for
it to be included in the results.
You can specify multiple filters (e.g., the key pair name includes the string Dave, and the fingerprint equals
a certain value). The result includes information for a particular key pair only if it matches all your filters.
If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-keypairs [keypair_name ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all key pairs you own, or only those
otherwise specified.
Example: --filter "tag-name=*Dave*"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the keypair with name gsg-keypair.
KEYPAIR gsg-keypair
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
Example Request
This example filters the results to display only key pairs whose names include the string Dave.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeKeyPairs
Related Commands
• ec2-create-keypair (p. 99)
• ec2-delete-keypair (p. 175)
• ec2-import-keypair (p. 458)
ec2-describe-network-acls
Description
Describes the network ACLs in your VPC.
You can filter the results to return information only about ACLs that match criteria you specify. For example,
you could get information only for the ACL associated with a particular subnet. The ACL must match at
least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the ACL is associated with a particular subnet and has an egress
entry that denies traffic to a particular port). The result includes information for a particular ACL only if it
matches all your filters. If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
For more information about Amazon Virtual Private Cloud and network ACLs, see Network ACLs in the
Amazon Virtual Private Cloud User Guide.
Syntax
ec2-describe-network-acls [network_acl_id...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all network ACLs in the
VPC, or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes all the network ACLs in your VPC.
PROMPT> ec2-describe-network-acls
NETWORKACL acl-5566953c vpc-5266953b default
ENTRY egress 100 allow 0.0.0.0/0 all
ENTRY egress 32767 deny 0.0.0.0/0 all
ENTRY ingress 100 allow 0.0.0.0/0 all
ENTRY ingress 32767 deny 0.0.0.0/0 all
NETWORKACL acl-5d659634 vpc-5266953b
ENTRY egress 110 allow 0.0.0.0/0 6 49152 65535
ENTRY egress 32767 deny 0.0.0.0/0 all
ENTRY ingress 110 allow 0.0.0.0/0 6 80 80
ENTRY ingress 120 allow 0.0.0.0/0 6 443 443
ENTRY ingress 32767 deny 0.0.0.0/0 all
ASSOCIATION aclassoc-5c659635 subnet-ff669596
ASSOCIATION aclassoc-c26596ab subnet-f0669599
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeNetworkAcls
Related Commands
• ec2-create-network-acl (p. 103)
• ec2-delete-network-acl (p. 178)
• ec2-replace-network-acl-association (p. 514)
• ec2-create-network-acl-entry (p. 106)
• ec2-delete-network-acl-entry (p. 181)
• ec2-replace-network-acl-entry (p. 517)
ec2-describe-network-interface-attribute
Description
Describes a network interface attribute. Only one attribute can be specified per call.
Syntax
ec2-describe-network-interface-attribute NETWORKINTERFACE -d, --description
--source-dest-check --group-set -a, --attachment
Options
Name Description Required
--group-set Describes the security groups for the network interface. Yes
Type: String
-a, --attachment Describes the attachment (if any) of the network Yes
interface.
Type: String
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the specified network interface attribute.
Examples
Example Request
This example lists the network interface's description.
This example enables source/destination checking on traffic across the specified network interface.
This example lists the security groups for the specified network interface.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeNetworkInterfaceAttribute
Related Commands
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interfaces (p. 318)
• ec2-attach-network-interface (p. 37)
• ec2-detach-network-interface (p. 421)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
ec2-describe-network-interfaces
Description
Describes one or more network interfaces. The NETWORKINTERFACE parameters, if specified, are the
IDs of the network interfaces to describe.
You can filter the results to return information only about network interfaces that match criteria you specify.
For example, you could get information about only network interfaces launched in a specific Availability
Zone.You can specify multiple values for a filter (e.g., more than one Availability Zone). A network interface
must match at least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the network interface is in a specific Availability Zone, and its owner
ID matches a specific owner ID). A network interface must match all the filters for it to be included in the
results. If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-network-interfaces --filter FILTER
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: None
Example: -F "description=My ENI"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
The command lists information about the specified network interfaces.
Examples
Example Request
This example lists all network interfaces that you own.
PROMPT> ec2-describe-network-interfaces
NETWORKINTERFACE eni-5e318a37 subnet-c53c87ac vpc-cc3c87a5
ap-southeast-1b 053230519467 false in-use 02:81:60:c7:15:3d
10.0.0.79 true
GROUP sg-084b5664 quick-start-4 ATTACHMENT i-5a0f6b0e eni-attach-
59bf7430 attached true
PRIVATEIPADDRESS 10.0.0.79
PRIVATEIPADDRESS 10.0.0.183
PRIVATEIPADDRESS 10.0.0.184
This example filters for a network interface with the private IP address of 10.0.0.26.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeNetworkInterfaces
Related Commands
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-attach-network-interface (p. 37)
• ec2-detach-network-interface (p. 421)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
ec2-describe-placement-groups
Description
Describes the placement groups in your account. For more information about placement groups and
cluster instances, see Using Cluster Instances in the Amazon Elastic Compute Cloud User Guide.
You can filter the results to return information only about placement groups that match criteria you specify.
For example, you could filter the results to return only the groups whose state is deleted.You can specify
multiple values for a filter. A placement group must match at least one of the specified values for it to be
included in the results.
You can specify multiple filters (e.g., the group's state is deleted and the name includes the string
Project). The result includes information for a particular group only if it matches all your filters. If there's
no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all placement groups you own, or
only those otherwise specified.
Example: --filter "group-name=*Project*"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
Examples
Example Request
This example describes all your placement groups.
PROMPT> ec2-describe-placement-groups
PLACEMENTGROUP XYZ-cluster cluster available
PLACEMENTGROUP ABC-cluster cluster available
Example Request
This example filters the results to display only placement groups that include the string Project in the
name.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribePlacementGroups
Related Commands
• ec2-create-placement-group (p. 116)
• ec2-delete-placement-group (p. 188)
ec2-describe-regions
Description
Describes Regions that are currently available to the account.
You can use filters with this call just as you can with other "describe" calls.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-regions [region...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all Regions, or those otherwise
specified.
Example: --filter "endpoint=*ap*"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example displays information about all the Regions that are available to the account.
PROMPT> ec2-describe-regions
REGION ap-northeast-1 ec2.ap-northeast-1.amazonaws.com
REGION ap-southeast-1 ec2.ap-southeast-1.amazonaws.com
..
Example Request
This example displays information about all Regions that have the string ap in the endpoint.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeRegions
Related Commands
• ec2-describe-availability-zones (p. 231)
• ec2-run-instances (p. 568)
ec2-describe-reserved-instances
Description
Describes the Reserved Instances that you purchased.
Starting with the 2011-11-01 API version, AWS expanded its offering for Amazon EC2 Reserved Instances
to address a range of projected instance use. There are three types of Reserved Instances based on
customer utilization levels: Heavy Utilization, Medium Utilization, and Light Utilization. The Medium
Utilization offering type is equivalent to the Reserved Instance offering available before API version
2011-11-01. If you are using tools that predate the 2011-11-01 API version, you only have access to the
Medium Utilization Reserved Instance offering type.
For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute
Cloud User Guide.
You can filter the results to return information about Reserved Instances that matches criteria you specify.
For example, you could get information about Reserved Instances in a particular Availability Zone. Or
you can specify multiple values for a filter. A Reserved Instance must match at least one of the specified
values for it to be included in the results.
You can specify multiple filters as well. For example, you could specify that your Reserved Instance must
be in a particular Availability Zone and must be tagged with a particular value. The result includes
information for a particular instance only if it matches all of your filters. If there's no match, no special
message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
availability-zone The Availability Zone where the Reserved Instance can be used.
Type: String
duration The duration of the Reserved Instance (one year or three years), in
seconds.
Type: xs:long
Valid values: 31536000 | 94608000
instance-type The instance type on which the Reserved Instance can be used.
Type: String
start The time at which the Reserved Instance purchase request was
placed, e.g., 2010-08-07T11:54:42.000Z.
Type: xsd:dateTime
tag-key The key of a tag assigned to the resource. This filter is independent
of the tag-value filter. For example, if you use both the filter
tag-key=Purpose and the filter tag-value=X, you get any
resources assigned both the tag key Purpose (regardless of what
the tag's value is), and the tag value X (regardless of what the tag's
key is). If you want to list only resources where Purpose=X, see the
tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon
Elastic Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent
of the tag-key filter.
Type: String
usage-price The usage price of the Reserved Instance, per hour (e.g., 0.84)
Type: xs:double
Syntax
ec2-describe-reserved-instances [reservation_id ...] [[--filter name=value]
...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all Reserved Instances you own,
or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes Reserved Instances owned by your account.
PROMPT> ec2-describe-reserved-instances
RESERVEDINSTANCES 1ba8e2e3-2538-4a35-b749-1f4442d50744 us-east-1a
m1.small Linux/UNIX 3y 0.03 350.0 1 2009-03-13T16:01:39+0000
payment-pending
RESERVEDINSTANCES af9f760e-c1c1-449b-8128-1342d3a6927d us-east-1d
m1.xlarge Linux/UNIX 1y 0.24 1820.0 1 2009-03-13T16:01:39+0000
active
Example Request
This example filters the results to display only one-year, m1.small Linux/UNIX Reserved Instances. If you
want Linux/UNIX Reserved Instances specifically for use with Amazon VPC, set the product descripton
to Linux/UNIX (Amazon VPC).
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeReservedInstances
Related Commands
• ec2-describe-reserved-instances-offerings (p. 339)
• ec2-purchase-reserved-instances-offering (p. 497)
ec2-describe-reserved-instances-offerings
Description
Describes Reserved Instance offerings that are available for purchase. With Amazon EC2 Reserved
Instances, you purchase the right to launch Amazon EC2 instances for a period of time (without getting
insufficient capacity errors) and pay a lower usage rate for the actual time used.
Starting with the 2011-11-01 API version, AWS expanded its offering of Amazon EC2 Reserved Instances
to address a range of projected instance use. There are three types of Reserved Instances based on
customer utilization levels: Heavy Utilization, Medium Utilization, and Light Utilization. You determine the
type of the Reserved Instance offering by including the optional offering-type parameter when calling
ec2-describe-reserved-instances-offerings. The Medium Utilization offering type is equivalent
to the Reserved Instance offering available before API version 2011-11-01. If you are using tools that
predate the 2011-11-01 API version, ec2-describe-reserved-instances-offerings will only list
information about the Medium Utilization Reserved Instance offering type.
For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute
Cloud User Guide.
Our policy is to provide filters for all describe calls so that you can limit the results to your specified criteria.
Therefore, you can use filters to limit the results when describing Reserved Instances offerings, even
though you can use the regular request parameters to do something similar.
For example, you could use the regular request parameters or a filter to get the offerings for a particular
instance type. You can specify multiple request parameters or multiple filters (e.g., limit the results to the
m2.xlarge instance type, and only for Windows instances). The result includes information for a particular
offering only if it matches all of your request parameters or filters. If there's no match, no special message
is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-reserved-instances-offerings [offering_id ...] [--type instance_type
...] [--offering-type offering] [--availability-zone zone ...] [--description
description ...] [[--filter name=value] ...] [--tenancy tenancy]
Options
Name Description Required
-F, --filter FILTER A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all Reserved Instances offerings,
or those otherwise specified.
Example: --filter "instance-type=m1.small"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes available Reserved Instance offerings in the us-east-1 Availability Zone.
Example Request
This example filters the results to display only one-year, m1.small or m1.large Linux/UNIX Reserved
Instances. If you want Linux/UNIX Reserved Instances specifically for use with Amazon VPC, set the
product description to Linux/UNIX (Amazon VPC).
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeReservedInstancesOfferings
Related Commands
• ec2-describe-reserved-instances (p. 333)
• ec2-purchase-reserved-instances-offering (p. 497)
ec2-describe-route-tables
Description
Describes your route tables. You can filter the results to return information only about tables that match
criteria you specify. For example, you could get information only about a table associated with a particular
subnet. You can specify multiple values for the filter. The table must match at least one of the specified
values for it to be included in the results.
You can specify multiple filters (e.g., the table has a particular route, and is associated with a particular
subnet). The result includes information for a particular table only if it matches all your filters. If there's
no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
For more information about Amazon Virtual Private Cloud and route tables, see Route Tables in the
Amazon Virtual Private Cloud User Guide.
Syntax
ec2-describe-route-tables [route_table_id...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all route tables in the VPC,
or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the route table with ID rtb-6aa34603.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeRouteTables
Related Commands
• ec2-associate-route-table (p. 30)
• ec2-delete-route-table (p. 194)
• ec2-disassociate-route-table (p. 435)
• ec2-replace-route-table-association (p. 525)
ec2-describe-snapshot-attribute
Description
Describes an attribute of a snapshot. You can describe one attribute at a time.
Syntax
ec2-describe-snapshot-attribute snapshot_id attribute
Options
Name Description Required
-p, --product-codes Describes the product codes associated with the Conditional
snapshot. Each product code contains a product code
and a type.
Type: String
Default: None
Example: -p
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes permissions for the snap-7ddb6e14 snapshot.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSnapshotAttribute
Related Commands
• ec2-create-snapshot (p. 126)
• ec2-describe-snapshots (p. 354)
• ec2-modify-snapshot-attribute (p. 487)
• ec2-reset-snapshot-attribute (p. 553)
ec2-describe-snapshots
Description
Describes the Amazon EBS snapshots available to you. Snapshots available to you include public
snapshots available for any AWS account to launch, private snapshots you own, and private snapshots
owned by another AWS account but for which you've been given explicit create volume permissions.
Permission Description
public The owner of the snapshot granted create volume permissions for the snapshot
to the all group. All AWS accounts have create volume permissions for these
snapshots.
explicit The owner of the snapshot granted create volume permissions to a specific AWS
account.
implicit An AWS account has implicit create volume permissions for all snapshots it owns.
You can modify the list of snapshots returned by specifying snapshot IDs, snapshot owners, or AWS
accounts with create volume permissions. If you don't specify any options, Amazon EC2 returns all
snapshots for which you have create volume permissions.
If you specify one or more snapshot IDs, only snapshots that have the specified IDs are returned. If you
specify an invalid snapshot ID, an error is returned. If you specify a snapshot ID for which you do not
have access, it will not be included in the returned results.
If you specify one or more snapshot owners, only snapshots from the specified owners and for which you
have access are returned. The results can include the AWS account IDs of the specified owners, amazon
for snapshots owned by Amazon, or self for snapshots that you own.
If you specify a list of restorable users, only snapshots with create snapshot permissions for those users
are returned. You can specify AWS account IDs (if you own the snapshot(s)), self for snapshots for
which you own or have explicit permissions, or all for public snapshots.
Tip
Use the --help option to view examples of ways to use this command.
You can filter the results to return information only about snapshots that match criteria you specify. For
example, you could get information about snapshots whose status is pending. You can specify multiple
values for a filter (e.g., the snapshot's status is either pending or completed). A snapshot must match
at least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the snapshot's status is pending, and it is tagged with a particular
value). The result includes information for a particular snapshot only if it matches all your filters. If there's
no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
owner-alias The AWS account alias (e.g., amazon) that owns the snapshot.
Type: String
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
Syntax
ec2-describe-snapshots [snapshot_id ...] [-a] [-o owner ...] [-r user_id]
[[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all snapshots you own, or only
those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes snapshot snap-7ddb6e14.
Example Request
This example filters the results to display only snapshots with the pending status, and that are also
tagged with a value that includes the string db_.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSnapshots
Related Commands
• ec2-create-snapshot (p. 126)
• ec2-delete-snapshot (p. 197)
ec2-describe-spot-datafeed-subscription
Description
Describes the datafeed for Spot Instances. For more information about Spot Instances, see Spot Instances
in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-describe-spot-datafeed-subscription
Options
This command does not have any options.
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the datafeed for the account.
PROMPT> ec2-describe-spot-datafeed-subscription
SPOTDATAFEEDSUBSCRIPTION 111122223333 myawsbucket spotdata
Active
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSpotDatafeedSubscription
Related Commands
• ec2-create-spot-datafeed-subscription (p. 130)
• ec2-delete-spot-datafeed-subscription (p. 200)
ec2-describe-spot-instance-requests
Description
Describes the Spot Instance requests that belong to your account. Spot Instances are instances that
Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot
Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current
Spot Instance requests. For more information about Spot Instances, see Spot Instances in the Amazon
Elastic Compute Cloud User Guide.
You can filter the results to return information only about Spot Instance requests that match criteria you
specify. For example, you could get information about requests where the Spot Price you specified is a
certain value (however, you can't use greater than or less than comparison, but you can use * and ?
wildcards). You can specify multiple values for a filter. A Spot Instance request must match at least one
of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the Spot Price is equal to a particular value, and the instance type
is m1.small). The result includes information for a particular request only if it matches all your filters. If
there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-spot-instance-requests [request_id ...] [[--filter name=value]
...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all Spot Instance requests you own,
or those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• The request ID
• Spot Price
• Type
• State (active, open, closed, cancelled, failed)
• Fault
• Valid From
• Valid Until
• Launch Group
• Availability Zone Group
• Launched Availability Zone
• Launch Specification
• Create Time
• Description
• Any tags assigned to the request
Examples
Example Request
This example returns information about a specific Spot Instance request.
Example Request
This example describes all persistent Spot Instance requests that have resulted in the launch of at least
one m1.small instance, that has been fulfilled in the us-east-1a Availability Zone, and that also has
monitoring enabled.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSpotInstanceRequests
Related Commands
• ec2-cancel-spot-instance-requests (p. 70)
• ec2-describe-spot-price-history (p. 371)
• ec2-request-spot-instances (p. 533)
ec2-describe-spot-price-history
Description
Describes the Spot Price history. Spot Instances are instances that Amazon EC2 starts on your behalf
when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets
the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more
information about Spot Instances, see Spot Instances in the Amazon Elastic Compute Cloud User Guide.
When you use the availability-zone option, this command describes the price history for the specified
Availability Zone with the most recent set of prices listed first. If you don't specify an Availability Zone,
the command returns the prices across all Availability Zones, starting with the most recent set. However,
if you use this command with versions of the API earlier than the 2011-05-15 version, this command
returns the lowest price across the Region for the given time period. The prices returned are listed in
chronological order — from the oldest to the most recent.
Note
Our policy is to provide filters for all "describe" calls so you can limit the results to your specified
criteria. Therefore, you can use filters to limit the results when describing Spot Price histories,
even though you can use the regular request parameters to do something similar.
For example, you could use the regular request parameters or a filter to get the history for a particular
instance type. You can specify multiple request parameters or multiple filters (e.g., limit the results to the
m2.xlarge instance type, and only for Windows instances). The result includes information for a particular
price history only if it matches all your request parameters or filters. If there's no match, no special message
is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
spot-price The Spot Price. The value must match exactly (or use wildcards; greater than
or less than comparison is not supported).
Type: String
Syntax
ec2-describe-spot-price-history [--start-time timestamp] [--end-time timestamp]
[--instance-type type] [--product-description description] [[--filter name=value]
...] [--availability-zone zone]
Options
Name Description Required
-s, --start-time The start date and time of the Spot Instance price No
timestamp history data.
Type: DateTime
Default: None
Example: -s 2009-12-01T11:51:50.000Z
-e, --end-time The end date and time of the Spot Instance price No
timestamp history data.
Type: DateTime
Default: None
Example: -e 2009-12-31T11:51:50.000Z
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Lists all available history information, or just
that information otherwise specified.
Example: --filter "product-description=Linux/UNIX"
-a, The Availability Zone for which you want to get the No
--availability-zone price history
zone Type: String
Default: None
Example: us-east-1a
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example returns Spot Price history for m1.small instances for a particular day in May.
The following example uses filters instead of request options to get the same results.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSpotPriceHistory
Related Commands
• ec2-cancel-spot-instance-requests (p. 70)
• ec2-describe-spot-instance-requests (p. 363)
• ec2-request-spot-instances (p. 533)
ec2-describe-subnets
Description
Describes your subnets. You can filter the results to return information only about subnets that match
criteria you specify. For example, you could get information only about subnets whose state is available.
You can specify multiple values for the filter. The subnet must match at least one of the specified values
for it to be included in the results.
You can specify multiple filters (e.g., the subnet is in a particular VPC, and the subnet's state is
available). The result includes information for a particular subnet only if it matches all your filters. If
there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
cidr The CIDR block of the subnet. The CIDR block you specify must exactly
match the subnet's CIDR block for information to be returned for the subnet.
Type: String
Constraints: Must contain the slash followed by one or two digits (e.g., /28)
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
Syntax
ec2-describe-subnets [ subnet_id ... ] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all subnets you own, or only
those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example gives a description of two subnets with IDs subnet-9d4a7b6c and subnet-6e7f829e.
Example Request
This example uses filters to give a description of any subnet you own that is in the VPC with ID
vpc-1a2b3c4d or vpc-6e7f8a92, and whose state is available. The response indicates that the VPC
with ID vpc-6e7f8a92 doesn't have any subnets that match.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeSubnets
Related Commands
• ec2-create-subnet (p. 133)
• ec2-delete-subnet (p. 203)
ec2-describe-tags
Description
Describes your tags. For more information about tags, see Using Tags in the Amazon Elastic Compute
Cloud User Guide.
You can use filters to limit the results when describing tags. For example, you could get only the tags for
a particular resource type. You can specify multiple values for a filter. A tag must match at least one of
the specified values for it to be included in the results.
You can specify multiple filters (e.g., limit the results to a specific resource type, and get only tags with
values that contain the string database). The result includes information for a particular tag only if it
matches all your filters. If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-tags [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all tags you own, or only those
otherwise specified.
Example: --filter "resource-type=instance"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes all the tags belonging to your account.
PROMPT> ec2-describe-tags
TAG ami-1a2b3c4d image webserver
TAG ami-1a2b3c4d image stack Production
TAG i-5f4e3d2a instance webserver
TAG i-5f4e3d2a instance stack Production
TAG i-12345678 instance database_server
TAG i-12345678 instance stack Test
Example Request
This example describes the tags for the AMI with ID ami-1a2b3c4d.
Example Request
This example describes the tags for all your instances.
Example Request
This example describes the tags for all your instances tagged with the name webserver.
Example Request
This example describes the tags for all your instances tagged with either stack=Test or stack=Production.
Example Request
This example describes the tags for all your instances tagged with Purpose=[empty string].
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeTags
Related Commands
• ec2-create-tags (p. 137)
• ec2-delete-tags (p. 206)
ec2-describe-volume-attribute
Description
Describes an attribute of a volume.
Syntax
ec2-describe-volume-attribute volume_id ...
<replace>attribute</replace>
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Example
Example Request
This example describes the autoEnableIo attribute of the volume vol-999999.
Example Request
This example describes the productCodes attribute of the volume vol-777777.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeVolumeAttribute
Related Commands
• ec2-describe-volume-status (p. 390)
• ec2-enable-volume-io (p. 438)
• ec2-modify-volume-attribute (p. 491)
ec2-describe-volume-status
Description
Describes the status of one or more volumes. Volume status provides the result of the checks performed
on your volumes to determine events that can impair the performance of your volumes. The performance
of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying
host experiences a power outage or system issue, once the system is restored, there could be data
inconsistencies on the volume. Volume events notify you if this occurs. Volume action notifies you if any
action needs to be taken in response to the event.
The DescribeVolumeStatus operation provides the following information about the specified volumes:
Status: Reflects the current status of the volume. The possible values are ok, impaired , or
insufficient-data. If all checks pass, the overall status of the volume is ok. If the check fails, the
overall status is impaired. If the status is insufficient-data, then the checks may still be taking
place on your volume at the time. We recommend you retry the request. For more information on volume
status, see Monitoring the Status of Your Volumes.
Events: Reflect the cause of a volume status and may require you to take an action. For example, if your
volume returns an impaired status, then the volume event might be potential-data-inconsistency.
This means that your volume has been impacted by an issue with the underlying host, has all I/O operations
disabled, and may have inconsistent data.
Actions: Reflect the actions you may have to take in response to an event. For example, if the status of
the volume is impaired and the volume event shows potential-data-inconsistency, then the
action will show enable-volume-io. This means that you may want to to enable the I/O operations for
the volume by issuing the ec2-enable-volume-io (p. 438) command and then check the volume for data
consistency.
Note
Volume status only has one status check. It does not check volume state as reported by
DescribeVolumes. Therefore, it does not detect volumes in the ERROR state (i.e., when a volume
is incapable of accepting I/Os because it is in an error state.)
You can filter the results to return information only about volumes that match criteria you specify. For
example, you could get information about volumes that have impaired status. You can specify multiple
values for a filter (e.g., more than one Availability Zone). A volume must match at least one of the specified
values for it to be included in the results.
You can specify multiple filters (e.g., the volume is in a specific Availability Zone and its status is set to
impaired). A volume must match all the filters for it to be included in the results. If there's no match, no
special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-volume-status [volume_id ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all volumes you own, or those
otherwise specified.
Example: --filter "volume-status.status=Ok"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes the status of the volumes vol-111111 and vol-222222.
Example Request
This example describes the volumes associated with your account that have failing I/O operations.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeVolumeStatus
Related Commands
• ec2-describe-volume-attribute (p. 386)
• ec2-enable-volume-io (p. 438)
• ec2-modify-volume-attribute (p. 491)
ec2-describe-volumes
Description
Describes your Amazon EBS volumes. For more information about Amazon EBS, see Using Amazon
Elastic Block Store in the Amazon Elastic Compute Cloud User Guide.
You can filter the results to return information only about volumes that match criteria you specify. For
example, you could get information about volumes whose status is available. You can specify multiple
values for a filter (e.g., the volume's status is either available or in-use). A volume must match at
least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the volume's status is available, and it is tagged with a particular
value). The result includes information for a particular volume only if it matches all your filters. If there's
no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
Syntax
ec2-describe-volumes [volume_id ...] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter A filter for limiting the results. See the preceding table No
name=value for a list of allowed filter names and values. You need
to use quotation marks if the value string has a space
(e.g., "name=value example"). If you're using the
command line tools on a Windows system, you might
need to use quotation marks, even when there is no
space in the value string (e.g., "name=value").
Type: String
Default: Describes all volumes you own, or those
otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example describes all volumes associated with your account.
PROMPT> ec2-describe-volumes
VOLUME vol-4d826724 800 us-east-1a in-use 2008-02-14T00:00:00+0000
ATTACHMENT vol-4d826724 i-6058a509 /dev/sdh attached 2008-02-14T00:00:17+0000
VOLUME vol-50957039 13 us-east-1a available 2008-02-091T00:00:00+0000
VOLUME vol-6682670f 1 us-east-1a in-use 2008-02-11T12:00:00+0000
ATTACHMENT vol-6682670f i-69a54000 /dev/sdh attached 2008-02-11T13:56:00+0000
VOLUME vol-932685fa 15 snap-a08912c9 us-east-1a in-use 2010-03-
31T12:17:07+0000
ATTACHMENT vol-932685fa i-71ca481a /dev/sda1 attached 2010-04-
06T14:16:00+0000
VOLUME vol-8975dae0 15 snap-a08912c9 us-east-1c deleting 2010-04-
07T14:59:27+0000
VOLUME vol-35be105c 10 us-east-1a available 2010-04-08T07:57:15+0000
Example Request
This example describes all volumes that are both attached to instance i-1a2b3c4d and also set to delete
when the instance terminates.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeVolumes
Related Commands
• ec2-create-snapshot (p. 126)
• ec2-delete-snapshot (p. 197)
ec2-describe-vpcs
Description
Describes your VPCs. You can filter the results to return information only about VPCs that match criteria
you specify. For example, you could get information only about VPCs whose state is available. You
can specify multiple values for the filter. A VPC must match at least one of the specified values for it to
be included in the results.
You can specify multiple filters (e.g., the VPC uses one of several sets of DHCP options, and the VPC's
state is available). The result includes information for a particular VPC only if it matches all your filters.
If there's no match, no special message is returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
cidr The CIDR block of the VPC. The CIDR block you specify must exactly match
the VPC's CIDR block for information to be returned for the VPC.
Type: String
Constraints: Must contain the slash followed by one or two digits (e.g., /28)
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
Syntax
ec2-describe-vpcs [ vpc_id ... ] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all VPCs you own, or only
those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example gives a description of the VPC with ID vpc-1a2b3c4d.
Example Request
This example uses filters to give a description of any VPC you own that uses the set of DHCP options
with ID dopt-7a8b9c2d or dopt-2b2a3d3c and whose state is available.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeVpcs
Related Commands
• ec2-create-vpc (p. 145)
• ec2-delete-vpc (p. 213)
• ec2-associate-dhcp-options (p. 26)
• ec2-create-dhcp-options (p. 80)
ec2-describe-vpn-connections
Description
Describes your VPN connections. You can filter the results to return information only about VPN
connections that match criteria you specify. For example, you could get information only about VPN
connections whose state is pending or available. You can specify multiple values for the filter. A VPN
connection must match at least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the VPN connection is associated with a particular virtual private
gateway, and the gateway's state is pending or available). The result includes information for a
particular VPN connection only if it matches all your filters. If there's no match, no special message is
returned; the response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
type The type of VPN connection. Currently the only supported type is ipsec.1.
Type: String
Valid values: ipsec.1
vpn-gateway-id The ID of a virtual private gateway associated with the VPN connection.
Type: String
For VPN connections in the pending or available state only, you can also optionally get the configuration
information for the VPN connection's customer gateway. You do this by specifying a format with the
--format option, or by specifying an XSL stylesheet of your own design with the --stylesheet option
(you were also able to do this when you created the VPN connection).
For more information about Amazon Virtual Private Cloud and VPN connections, see Adding an IPsec
Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-describe-vpn-connections [vpn_connection_id ... ] [{--format format} |
{--stylesheet your_stylesheet}] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all VPN connections you
own, or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example gives a description of the VPN connection with ID vpn-44a8938f. The example specifies
that the configuration information be formatted as needed for a Cisco customer gateway. Because it's a
long set of information, we haven't displayed it here in the response. To see an example of the configuration
information, see the Amazon Virtual Private Cloud Network Administrator Guide.
Example Request
This example uses filters to give a description of any VPN connection you own associated with the
customer gateway with ID cgw-b4dc3961, and whose state is either pending or available. Note that
it doesn't use the option that causes the output to include the customer gateway configuration.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeVpnConnections
Related Commands
• ec2-create-vpn-connection (p. 149)
• ec2-delete-vpn-connection (p. 216)
ec2-describe-vpn-gateways
Description
Describes your virtual private gateways. You can filter the results to return information only about virtual
private gateways that match criteria you specify. For example, you could get information only about virtual
private gateways whose state is pending or available. You can specify multiple values for the filter.
A virtual private gateway must match at least one of the specified values for it to be included in the results.
You can specify multiple filters (e.g., the virtual private gateway is in a particular Availability Zone and
the gateway's state is pending or available). The result includes information for a particular virtual
private gateway only if it matches all your filters. If there's no match, no special message is returned; the
response is simply empty.
You can use wildcards with the filter values: * matches zero or more characters, and ? matches exactly
one character. You can escape special characters using a backslash before the character. For example,
a value of \*amazon\?\\ searches for the literal string *amazon?\.
attachment.state The current state of the attachment between the gateway and the VPC.
Type: String
Valid values: attaching | attached | detaching | detached
tag-key The key of a tag assigned to the resource. This filter is independent of the
tag-value filter. For example, if you use both the filter tag-key=Purpose
and the filter tag-value=X, you get any resources assigned both the tag
key Purpose (regardless of what the tag's value is), and the tag value X
(regardless of what the tag's key is). If you want to list only resources where
Purpose=X, see the tag:key filter later in this table.
For more information about tags, see Using Tags in the Amazon Elastic
Compute Cloud User Guide.
Type: String
tag-value The value of a tag assigned to the resource. This filter is independent of the
tag-key filter.
Type: String
type The type of virtual private gateway. Currently the only supported type is
ipsec.1.
Type: String
Valid values: ipsec.1
For more information about Amazon Virtual Private Cloud and virtual private gateways, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-describe-vpn-gateways [vpn_gateway_id ... ] [[--filter name=value] ...]
Options
Name Description Required
-F, --filter name=value A filter for limiting the results. See the No
preceding table for a list of allowed filter names
and values. You need to use quotation marks
if the value string has a space (e.g.,
"name=value example"). If you're using the
command line tools on a Windows system, you
might need to use quotation marks, even when
there is no space in the value string (e.g.,
"name=value").
Type: String
Default: Describes all virtual private gateways
you own, or only those otherwise specified.
Example: --filter "tag-key=Production"
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example gives a description of the virtual private gateway with ID vgw-8db04f81.
Example Request
This example uses filters to give a description of any virtual private gateway you own that is in the
us-east-1a Availability Zone, and whose state is either pending or available.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DescribeVpnGateways
Related Commands
• ec2-create-vpn-gateway (p. 154)
• ec2-delete-vpn-gateway (p. 219)
ec2-detach-internet-gateway
Description
Detaches an Internet gateway from a VPC, disabling connectivity between the Internet and the VPC. The
VPC must not contain any running instances with Elastic IP addresses. For more information about your
VPC and Internet gateway, see the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-detach-internet-gateway vpn_gateway_id -c vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example detaches the Internet gateway with ID igw-eaad4883 from the VPC with ID vpc-11ad4878.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DetachInternetGateway
Related Commands
• ec2-detach-internet-gateway (p. 34)
• ec2-create-internet-gateway (p. 96)
• ec2-delete-internet-gateway (p. 172)
• ec2-describe-internet-gateways (p. 299)
ec2-detach-network-interface
Description
Detaches a network interface from an instance. The NETWORKATTACHMENT parameter is the ID of
the attachment.
Syntax
ec2-detach-network-interface NETWORKATTACHMENT -f, --force
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the name of the network attachment that was detached.
Examples
Example Request
This example detaches the specified network interface.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DetachNetworkInterface
Related Commands
• ec2-attach-network-interface (p. 37)
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-describe-network-interfaces (p. 318)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
ec2-detach-volume
Description
Detaches an Amazon EBS volume from an instance. Make sure to unmount any file systems on the
device within your operating system before detaching the volume. Failure to do so will result in volume
being stuck in "busy" state while detaching. For more information about Amazon EBS, see Using Amazon
Elastic Block Store in the Amazon Elastic Compute Cloud User Guide.
Note
If an Amazon EBS volume is the root device of an instance, it cannot be detached while the
instance is in the ‘running’ state. To detach the root volume, stop the instance first.
If the root volume is detached from an instance with an AWS Marketplace product code, then
the AWS Marketplace product codes from that volume are no longer associated with the instance.
Syntax
ec2-detach-volume volume_id [--instance instance_id [--device device]] [--force]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example detaches volume vol-4d826724.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DetachVolume
Related Commands
• ec2-attach-volume (p. 40)
• ec2-create-volume (p. 141)
• ec2-delete-volume (p. 210)
• ec2-describe-volumes (p. 396)
ec2-detach-vpn-gateway
Description
Detaches a virtual private gateway from a VPC. You do this if you're planning to turn off the VPC and not
use it anymore. You can confirm a virtual private gateway has been completely detached from a VPC by
describing the virtual private gateway (any attachments to the virtual private gateway are also described).
You must wait for the attachment's state to switch to detached before you can delete the VPC or attach
a different VPC to the virtual private gateway.
For more information about Amazon Virtual Private Cloud and virtual private gateways, see Adding an
IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-detach-vpn-gateway -p vpn_gateway_id -c vpc_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example detaches the virtual private gateway with ID vgw-8db04f81 from the VPC with VPC ID
vpc-1a2b3c4d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DetachVpnGateway
Related Commands
• ec2-attach-vpn-gateway (p. 44)
• ec2-describe-vpn-gateways (p. 413)
ec2-disassociate-address
Description
Disassociates an Elastic IP address from the instance or network interface it's assigned to.
This action applies to both EC2 Elastic IP addresses and VPC Elastic IP addresses. For information about
VPC addresses and how they differ from EC2 addresses, see Elastic IP Addresses in the Amazon Virtual
Private Cloud User Guide.
This is an idempotent action. If you enter it more than once, Amazon EC2 does not return an error.
Syntax
ec2-disassociate-address {ip_address | -a association_id}
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example disassociates the EC2 Elastic IP address (192.0.2.1) from the instance it's assigned to.
Example Request
This example disassociates the VPC Elastic IP address with association ID eipassoc-048c746d from the
instance it's assigned to.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DisassociateAddress
Related Commands
• ec2-allocate-address (p. 13)
• ec2-associate-address (p. 21)
• ec2-describe-addresses (p. 225)
• ec2-release-address (p. 510)
ec2-disassociate-route-table
Description
Disassociates a subnet from a route table.
After you perform this action, the subnet no longer uses the routes in the route table. Instead, it uses the
routes in the VPC's main route table. For more information about route tables, see Route Tables in the
Amazon Virtual Private Cloud User Guide.
Syntax
ec2-disassociate-route-table route_table_association_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example disassociates the route table with association ID rtbassoc-fdad4894 from the subnet it's
associated to.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• DisassociateRouteTable
Related Commands
• ec2-associate-route-table (p. 30)
• ec2-create-route-table (p. 123)
• ec2-delete-route-table (p. 194)
• ec2-describe-route-tables (p. 345)
• ec2-replace-route-table-association (p. 525)
ec2-enable-volume-io
Description
Enables I/O operations for a volume that had I/O operations disabled because the data on the volume
was potentially inconsistent.
Syntax
ec2-enable-volume-io volume_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a Boolean value indicating whether the request succeeded.
Example
Example Request
This example enables the I/O operations for the volume vol-232323.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• EnableVolumeIO
Related Commands
• ec2-describe-volume-status (p. 390)
ec2-fingerprint-key
Description
Computes and displays the fingerprint for a private key produced by Amazon EC2.
This operation is performed entirely on the client-side. Network access is not required.
Syntax
ec2-fingerprint-key keyfile
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• A key fingerprint. This is formatted as a hash digest with each octet separated by a colon
Examples
Example Request
This example computes and displays the fingerprint for the mykey.pem private key.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Commands
• ec2-describe-keypairs (p. 304)
ec2-get-console-output
Description
Retrieves console output for the specified instance.
Amazon EC2 instances do not have a physical monitor through which you can view their console output.
They also lack physical controls that allow you to power up, reboot, or shut them down. To allow these
actions, we provide them through the Amazon EC2 API and the command line tools.
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.
For Linux/UNIX instances, the Amazon EC2 instance console output displays the exact console output
that would normally be displayed on a physical monitor attached to a machine. This output is buffered
because the instance produces it and then posts it to a store where the instance's owner can retrieve it.
For Windows instances, the Amazon EC2 instance console output displays the last three system event
log errors.
Syntax
ec2-get-console-output instance_id [-r]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• The instance ID
• A timestamp indicating the time of the last update
• The instance console output. By default the ^ESC character is escaped and duplicate new-lines are
removed to facilitate reading
Examples
Example Request
This example retrieves the console output for the i-10a64379 Linux and UNIX instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• GetConsoleOutput
Related Commands
• ec2-run-instances (p. 568)
ec2-get-password
Description
Retrieves and decrypts the administrator password for the instances running Windows.
You must specify the key pair used to launch the instance.
Note
The Windows password is only generated the first time an AMI is launched. It is not generated
for rebundled AMIs or after the password is changed on an instance.
The password is encrypted using the key pair that you provided.
There is no SOAP or Query version of the ec2-get-password command.
Password generation and encryption takes a few moments. Please wait up to 15 minutes after
launching an instance before trying to retrieve the generated password.
Syntax
ec2-get-password instanceId -k key_file
Options
Name Description Required
-k, The file that contains the private key used to launch Yes
--priv-launch-key the instance.
key_file Type: String
Default: None
Example: -k windows-keypair.pem
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example returns the administrator password for the i-2574e22a instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• GetPasswordData
Related Commands
• ec2-run-instances (p. 568)
• ec2-describe-instances (p. 285)
ec2-import-instance
Description
Creates a new import instance task using metadata from the specified disk image, and imports the image
to Amazon EC2. For more information about prerequisites for importing an instance, see Before You Get
Started and Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon
Elastic Compute Cloud User Guide.
Note
If the upload task doesn't complete, use ec2-resume-import to resume the import from where it was
interrupted.
Syntax
ec2-import-instance -t instance_type [-g group] -f file_format -a architecture
-b s3_bucket_name [-o owner] -w secret_key [--prefix prefix] [--manifest-url
url] [-s volume_size ] [-z availability_zone] [-d description] [--user-data
user_data] [--user-data-file disk_image_filename] [--subnet subnet_id]
[--private-ip-address ip_address] [--monitor]
[--instance-initiated-shutdown-behavior behavior ] [--x days]
[--ignore-region-affinity] [--dry-run] [--no-upload] [--dont-verify-format]
Options
Name Description Required
Note
-g, --group group The security group within which the instances should No
be run. Determines the ingress firewall rules that are
applied to the launched instances. Only one security
group is supported for an instance.
Type: String
Default: Your default security group
Example: -g myGroup
-f, --format file_format The file format of the disk image. Yes
Type: String
Default: None
Valid values: VMDK | RAW | VHD
Example: -f VMDK
Note
--bucket s3_bucket_name The Amazon S3 destination bucket for the manifest. Yes
Type: String
Default: None
Condition: The --manifest-url parameter is not
specified.
Example: myawsbucket
-w, --owner-sak The secret access key of the bucket owner. Yes
secret_access_key Type: String
Default: None
Example:
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
--prefix prefix The prefix for the manifest file and disk image file parts No
within the Amazon S3 bucket.
Type: String
Default: None
Example: --prefix MyDiskParts
--manifest-url url The URL for an existing import manifest file already No
uploaded to Amazon S3.
Type: String
Default: None. This option cannot be specified if the
--bucket option is present.
Example: my-ami.manifest.xml
-s, --volume-size The size of the Amazon EBS volume, in GiB (2^30 No
volume_size bytes), that will hold the converted image. If not
specified, EC2 calculates the value using the disk
image file.
Type: String
Default: None
Example: -s 30
-x, --expires The validity period for the signed Amazon S3 URLS No
days that allow EC2 to access the manifest.
Type: String
Default: 30 days
Example: -x 10
--dry-run Does not create an import task, only validates that the No
disk image matches a known type.
Type: None
Default: None
Example: --dry-run
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
Example
Example Request
This example creates an import instance task that migrates a Windows Server 2008 SP2 (32-bit) VM into
the AWS us-east-1 Region.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ImportInstance
Related Commands
• ec2-cancel-conversion-task (p. 63)
• ec2-delete-disk-image (p. 164)
• ec2-describe-conversion-tasks (p. 240)
• ec2-import-volume (p. 462)
• ec2-resume-import (p. 557)
ec2-import-keypair
Description
Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with
ec2-create-keypair, in which AWS creates the key pair and gives the keys to you (AWS keeps a
copy of the public key). With ec2-import-keypair, you create the key pair and give AWS just the
public key. The private key is never transferred between you and AWS.
You can easily create an RSA key pair on Windows and Linux using the ssh-keygen command line tool
(provided with the standard OpenSSH installation). Standard library support for RSA key pair creation is
also available in Java, Ruby, Python, and many other programming languages.
Supported formats:
DSA keys are not supported. Make sure your key generator is set up to create RSA keys.
Syntax
ec2-import-keypair key_name --public-key-file key_file
Options
Name Description Required
-f, The path and name of the file containing the public Yes
--public-key-file key.
key_file Type: String
Default: None
Example: -f C:\keys\myfavoritekeypair_public.ppk
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
The command returns a table that contains the following information:
Examples
Example Request
This example imports the public key from the file C:\keys\mykey.ppk.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ImportKeyPair
Related Commands
• ec2-create-keypair (p. 99)
• ec2-delete-keypair (p. 175)
• ec2-describe-keypairs (p. 304)
ec2-import-volume
Description
Creates a new import volume task using metadata from the specified disk image, and imports the image
to Amazon EC2. For more information about prerequisites for importing a volume, see Before You Get
Started and Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon
Elastic Compute Cloud User Guide.
Note
If the upload task doesn't complete, use ec2-resume-import to resume the import from where it was
interrupted.
Syntax
ec2-import-volume disk_image -f file_format [-s volume_size] -z availability_zone
[-b s3_bucket_name] [-o owner] -w secret_key [--prefix prefix] [--manifest-url
url] [-d description] [--x days] [--ignore-region-affinity] [--dry-run]
[--no-upload] [--dont-verify-format]
Options
Name Description Required
-f, --format file_format The file format of the disk image. Yes
Type: String
Default: None
Valid values: VMDK | RAW | VHD
Example: -f VMDK
-b, --bucket bucket The Amazon S3 destination bucket for the manifest. Yes
Type: String
Default: None
Condition: Required when the --manifest-url
parameter is not specified.
Example: -b myawsbucket
-w, --owner-sak The secret access key of the bucket owner. Yes
secret_access_key Type: String
Default: None
Example:
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
--prefix prefix The prefix for the manifest file and disk image file parts No
within the Amazon S3 bucket.
Type: String
Default: None
Example: --prefix MyDiskParts
--manifest-url url The URL for an existing import manifest file already No
uploaded to Amazon S3.
Type: String
Default: None
Condition: This option cannot be specified if the
--bucket option is present.
Example: my-ami.manifest.xml
-x, --expires The validity period for the signed Amazon S3 URLS No
days that allow EC2 to access the manifest.
Type: String
Default: 30 days
Example: -x 10
--dry-run Does not create an import task, only validates that the No
disk image matches a known type.
Type: None
Default: None
Example: --dry-run
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
Example
Example Request
This example creates an import volume task that migrates a Windows Server 2008 (32-bit) volume into
the AWS us-east-1 Region.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ImportVolume
Related Commands
• ec2-cancel-conversion-task (p. 63)
• ec2-delete-disk-image (p. 164)
• ec2-describe-conversion-tasks (p. 240)
ec2-migrate-image
Description
Copies a bundled AMI from one Region to another.
Note
Syntax
ec2-migrate-image --private-key private_key --cert cert -U url --owner-akid
access_key_id --owner-sak secret_access_key --bucket source_s3_bucket
--destination-bucket destination_s3_bucket --manifest manifest_path --acl acl
--location {US | EU} --ec2cert ec2_cert_path [--kernel kernel-id] [--ramdisk
ramdisk_id] {--no-mapping} --region mapping_region_name
Options
Name Description Required
-C, --cert cert The user's PEM encoded RSA public key certificate No
file.
Type: String
Default: Uses EC2_CERT environment variable
Example: -C
cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-U, --url url The URL to use as the web service URL. No
Type: String
Default: https://ec2.amazonaws.com
Example: -U https://ec2.amazonaws.com
-w, --owner-sak The secret access key of the bucket owner. Yes
secret_access_key Type: String
Default: None
Example: -w
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
--acl acl The access control list policy of the bundled image. Yes
Type: String
Valid values: public-read | aws-exec-read
Default: None
Example: --acl public-read
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example copies the AMI specified in the my-ami.manifest.xml manifest from the US to the EU.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Commands
• ec2-register (p. 504)
• ec2-run-instances (p. 568)
ec2-modify-image-attribute
Description
Modifies an attribute of an AMI.
Note
AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace product
code cannot be made public.
Syntax
ec2-modify-image-attribute ami_id {-l (-a entity | -r entity) | --product-codes
code}
Options
Name Description Required
-a, --add entity Adds a launch permission for the specified AWS Yes
account or for all accounts.
Type: String
Valid values: AWS account identifier | all
Default: None
Example: --launch-permission --add all
-r, --remove entity Removes a launch permission for the specified AWS Yes
account or for all users.
Type: String
Valid values: AWS account identifier | all
Default: None
Example: --launch-permission --remove all
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example makes the AMI public (i.e., so any AWS account can launch it).
Example Request
This example makes the AMI private (i.e., so only you as the owner can launch it).
Example Request
This example grants launch permission to the AWS account with ID 444455556666.
Example Request
This example removes launch permission from the AWS account with ID 444455556666.
Example Request
This example adds the 774F4FF8 product code to the ami-61a54008 AMI.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ModifyImageAttribute
Related Commands
• ec2-reset-image-attribute (p. 542)
• ec2-describe-image-attribute (p. 262)
ec2-modify-instance-attribute
Description
Modifies an attribute of an instance.
Note
If you want to add instance store volumes to an Amazon EBS-backed instance, you must add
them when you launch the instance. For more information, see Overriding the AMI's Block Device
Mapping in the Amazon Elastic Compute Cloud User Guide, or Adding A Default Instance Store
in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-modify-instance-attribute instance_id {--instance-type type | --kernel
kernel_id | --ramdisk ramdisk_id | --user-data user_data |
--disable-api-termination Boolean | --instance-initiated-shutdown-behavior
behavior | --block-device-mapping mapping | --source-dest-check Boolean |
--group-id group_id [...] }
Options
Name Description Required
--kernel kernel_id Sets the ID of the kernel associated with the AMI. No
Type: String
Default: None
Example: --kernel aki-1a2b3c4d
--ramdisk Sets the ID of the RAM disk associated with the AMI. No
ramdisk_id Type: String
Default: None
Example: --ramdisk ari-1a2b3c4d
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example changes the kernel for the instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ModifyInstanceAttribute
Related Commands
• ec2-describe-instance-attribute (p. 274)
• ec2-reset-instance-attribute (p. 545)
ec2-modify-network-interface-attribute
Description
Modifies a network interface attribute. You can specify only one attribute at a time.
Syntax
ec2-modify-network-interface-attribute NETWORKINTERFACE -d, --description
DESCRIPTION -a, --attachment ATTACHMENT --delete-on-termination BOOLEAN
--source-dest-check BOOLEAN --group-id GROUP_ID
Options
Name Description Required
--group-id GROUP_ID Replaces the security groups for this network interface. Yes
Type: String
Default: None
Example: --group-id sg-b90619d5 –groupd id
sg-a92639c9
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the name of the attribute that was modified.
Examples
Example Request
This example adds a description to the network interface.
This example turns off source/destination checking for network traffic across the network interface.
This example changes the security group for the specified network interface.
This example retains the network interface when it is detached from an instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ModifyNetworkInterfaceAttribute
Related Commands
• ec2-attach-network-interface (p. 37)
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-describe-network-interfaces (p. 318)
• ec2-detach-network-interface (p. 421)
• ec2-reset-network-interface-attribute (p. 549)
ec2-modify-snapshot-attribute
Description
Adds or remove permission settings for the specified snapshot.
Note
Syntax
ec2-modify-snapshot-attribute snapshot_id -c [--add entity | --remove entity]
Options
Name Description Required
-a, --add entity Adds a permission for the specified AWS account or
for all accounts.
Type: String
Valid values: AWS account identifier | all
Default: None
Example: -c --add all
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example makes the snap-78a54011 snapshot public.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ModifySnapshotAttribute
Related Commands
• ec2-create-snapshot (p. 126)
• ec2-describe-snapshot-attribute (p. 351)
• ec2-describe-snapshots (p. 354)
• ec2-reset-snapshot-attribute (p. 553)
ec2-modify-volume-attribute
Description
Modifies a volume attribute.
By default, all I/O operations for the volume are suspended when the data on the volume is determined
to be potentially inconsistent, to prevent undetectable, latent data corruption. The I/O access to the volume
can be resumed by first issuing the ec2-enable-volume-io (p. 438) command to enable I/O access and
then checking the data consistency on your volume.
You can change the default behavior to resume I/O operations without issuing the
ec2-enable-volume-io (p. 438) command by setting the auto-enable-io attribute of the volume to true.
We recommend that you change this attribute only for volumes that are stateless or disposable, or for
boot volumes.
Syntax
ec2-modify-volume-attribute volume_id ... --attribute_flag ATTRIBUTE_VALUE
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Example
Example Request
This example modifies the attribute of the volume vol-999999.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ModifyVolumeAttribute
Related Commands
• ec2-describe-volume-attribute (p. 386)
• ec2-describe-volume-status (p. 390)
• ec2-enable-volume-io (p. 438)
ec2-monitor-instances
Description
Enables monitoring for a running instance. For more information, see Monitoring Your Instances and
Volumes in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-monitor-instances instance_id [instance_id...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• The instance ID
• The monitoring state
Examples
Example Request
This example enables monitoring for i-43a4412a and i-23a3397d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• MonitorInstances
Related Commands
• ec2-run-instances (p. 568)
• ec2-unmonitor-instances (p. 594)
ec2-purchase-reserved-instances-offering
Description
Purchases a Reserved Instance for use with your account. With Amazon EC2 Reserved Instances, you
purchase the right to launch Amazon EC2 instances for a period of time (without getting insufficient
capacity errors) and pay a lower usage rate for the actual time used.
Starting with the 2011-11-01 API version, AWS expanded its offering of Amazon EC2 Reserved Instances
to address a range of projected instance use. There are three types of Reserved Instances based on
customer utilization levels: Heavy Utilization, Medium Utilization, and Light Utilization. You determine the
type of the Reserved Instances offerings by including the optional offering-type parameter when
calling ec2-describe-reserved-instances-offerings. After you've identified the Reserved
Instance with the offering type you want, specify its --offering when you call
ec2-purchase-reserved-instances-offering.
The Medium Utilization offering type is equivalent to the Reserved Instance offering available before API
version 2011-11-01. If you are using tools that predate the 2011-11-01 API version,
ec2-describe-reserved-instances-offerings will only list information about the Medium
Utilization Reserved Instance offering type.
For more information about Reserved Instances, see Reserved Instances in the Amazon Elastic Compute
Cloud User Guide.
Syntax
ec2-purchase-reserved-instances-offering --offering offering --instance-count
count
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example illustrates a purchase of a Reserved Instances offering.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• PurchaseReservedInstancesOffering
Related Commands
• ec2-describe-reserved-instances (p. 333)
• ec2-describe-reserved-instances-offerings (p. 339)
ec2-reboot-instances
Description
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
you. Requests to reboot terminated instances are ignored.
Note
If a Linux/UNIX instance does not cleanly shut down within four minutes, Amazon EC2 will
perform a hard reboot.
Syntax
ec2-reboot-instances instance_id [instance_id ...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example reboots an instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• RebootInstances
Related Commands
• ec2-run-instances (p. 568)
ec2-register
Description
Registers a new AMI with Amazon EC2. When you're creating an AMI, this is the final step you must
complete before you can launch an instance from the AMI. For more information about creating AMIs,
see Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide.
Note
For Amazon EBS-backed instances, the ec2-create-image command creates and registers
the AMI in a single request, so you don't have to register the AMI yourself.
You can also use the ec2-register-image action to create an EBS-backed AMI from a snapshot of
a root device volume. For more information, see Launching an Instance from a Snapshot in the Amazon
Elastic Compute Cloud User Guide.
If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by
Amazon S3 invalidates its registration. If you make changes to an image, deregister the previous image
and register the new image.
Note
You cannot register an image where a secondary (non-root) snapshot has AWS Marketplace
product codes.
Syntax
ec2-register {[manifest] -n name [-a architecture] [-b mapping [...]] [-d
description] [-s snapshot_id] [--kernel kernel_id] [--ramdisk ramdisk_id]
[--root-device-name name]}
Options
Name Description Required
-b, Defines a block device mapping for the instance. This Conditional
--block-device-mapping argument is passed in the form of
mapping <devicename>=<blockdevice>.The devicename
is the name of the device within Amazon EC2. The
blockdevice can be one of the following values:
Note
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example registers the AMI specified in the image.manifest.xml manifest file, located in the bucket
named myawsbucket.
Example Request
This example registers an Amazon EBS snapshot to create an AMI backed by Amazon EBS.
Example Request
This example registers the AMI with an Amazon EBS snapshot as the root device, a separate snapshot
as a secondary device, and an empty 100 GiB Amazon EBS volume as a storage device.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• RegisterImage
Related Commands
• ec2-deregister (p. 222)
• ec2-describe-images (p. 266)
• ec2-run-instances (p. 568)
ec2-release-address
Description
Releases an Elastic IP address allocated to your account.
This command applies to both EC2 Elastic IP addresses and VPC Elastic IP addresses. For information
about VPC addresses and how they differ from EC2 addresses, see Elastic IP Addresses in the Amazon
Virtual Private Cloud User Guide.
If you run this action 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 (AuthFailure).
Note
For EC2 addresses only: Releasing an IP address automatically disassociates it from any instance
it's associated with. To disassociate an IP address without releasing it, use the
ec2-diassociate-address command.
If you try to release a VPC address that's associated with an instance, Amazon EC2 returns an
error (InvalidIPAddress.InUse).
Important
After releasing an Elastic IP address, it is released to the IP address pool and might be unavailable
to your account. Make sure to update your DNS records and any servers or devices that
communicate with the address.
Syntax
ec2-release-address [ip_address | -a allocation_id}
Options
Name Description Required
-a, --allocation-id The allocation ID that AWS provided when you Conditional
allocation_id allocated the address for use with Amazon VPC.
Type: String
Default: None
Condition: Required for VPC Elastic IP addresses.
Example: -a eipalloc-5723d13e
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example releases an EC2 Elastic IP address.
Example Request
This example releases a VPC Elastic IP address associated with the account.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ReleaseAddress
Related Commands
• ec2-allocate-address (p. 13)
• ec2-associate-address (p. 21)
• ec2-describe-addresses (p. 225)
• ec2-disassociate-address (p. 431)
ec2-replace-network-acl-association
Description
Changes which network ACL a subnet is associated with. By default when you create a subnet, it's
automatically associated with the default network ACL. For more information about network ACLs, see
Network ACLs in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-replace-network-acl-association network_acl_association_id -a network_acl_id
Options
Name Description Required
-a, --network-acl The ID of the new ACL to associate with the Yes
network_acl_id subnet.
Type: String
Default: None
Example: -a acl-10b95c79
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example starts with a network ACL associated with a subnet, and a corresponding association ID
aclassoc-e5b95c8c. You want to associate a different network ACL (acl-5fb85d36) with the subnet. The
result is a new association ID representing the new association.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ReplaceNetworkAclAssociation
Related Commands
• ec2-create-network-acl (p. 103)
• ec2-delete-network-acl (p. 178)
• ec2-describe-network-acls (p. 308)
ec2-replace-network-acl-entry
Description
Replaces an entry (i.e., rule) in a network ACL. For more information about network ACLs, see Network
ACLs in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-replace-network-acl-entry acl_id -n rule_number [--egress] -P protocol -r
cidr [-p port_range] [-t icmp_type_code] { --allow | --deny }
Options
Name Description Required
-P, --protocol The IP protocol. You can specify all or -1 to mean Yes
protocol all protocols.
Type: String
Valid values: all | -1 | tcp | udp | icmp or any
protocol number (for a list, see Protocol Numbers).
Example: -P 6
-r, --cidr cidr The CIDR range to allow or deny, in CIDR notation. Yes
Type: String
Default: None
Example: -r 172.16.0.0/24
-p, --port-range For TCP or UDP: The range of ports to allow. Conditional
port_range Type: String
Default: None
Valid values: A single integer or a range (min-max).
You can specify -1 to mean all ports (i.e. port range
0-65535).
Condition: Required if specifying tcp or udp (or the
equivalent number) for the protocol.
Example: -p 80-84
-t, For ICMP: The ICMP type and code using format Conditional
--icmp-type-code type:code, where both are integers. You can use -1
icmp_type_code for the type or code to mean all types or all codes
Type: String
Default: None
Condition: Required if specifying icmp (or the
equivalent number) for the protocol.
Example: -t -1:-1
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example replaces the egress entry numbered 110 in the network ACL with ID acl-2cb85d45. The
new rule denies egress traffic destined for anywhere (0.0.0.0/0) on TCP port 139.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ReplaceNetworkAclEntry
Related Commands
• ec2-create-network-acl-entry (p. 106)
• ec2-delete-network-acl-entry (p. 181)
• ec2-describe-network-acls (p. 308)
ec2-replace-route
Description
Replaces an existing route within a route table in a VPC. For more information about route tables, see
Route Tables in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-replace-route route_table_id -r cidr {-g gateway_id | -i instance_id | -n,
--network-interface NETWORKINTERFACE}
Options
Name Description Required
-r, --cidr The CIDR address block used for the Yes
cidr destination match. Routing decisions are based
on the most specific match.
Type: String
Default: None
Example: -r 0.0.0.0/0
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example replaces a route in the route table with ID rtb-e4ad488d. The new route matches the CIDR
10.0.0.0/8 and sends it to the virtual private gateway with ID vgw-1d00376e.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ReplaceRoute
Related Commands
• ec2-create-route (p. 119)
• ec2-delete-route (p. 191)
• ec2-describe-route-tables (p. 345)
ec2-replace-route-table-association
Description
Changes the route table associated with a subnet in a VPC.
You can also use this to change which table is the main route table in the VPC. You just specify the main
route table's association ID and the route table that you want to be the new main route table.
After you execute this action, the subnet uses the routes in the new route table it's associated with. For
more information about route tables, see Route Tables in the Amazon Virtual Private Cloud User Guide.
Syntax
ec2-replace-route-table-association route_table_association_id -r route_table_id
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example starts with a route table associated with a subnet, and a corresponding association ID
rtbassoc-f8ad4891. You want to associate a different route table (table rtb-f9ad4890) to the subnet. The
result is a new association ID representing the new association.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ReplaceRouteTableAssociation
Related Commands
• ec2-create-route-table (p. 123)
• ec2-delete-route-table (p. 194)
• ec2-describe-route-tables (p. 345)
• ec2-disassociate-route-table (p. 435)
• ec2-replace-route-table-association (p. 525)
ec2-report-instance-status
Description
Reports the status for instances that you own.
This command works only for instances that are in the running state. If you disagree with the instance
status returned by the ec2-report-instance-status action, use ec2-report-instance-status
command to report a more accurate status. Amazon EC2 collects this information to improve the accuracy
of status checks.
Note
Use of this action does not change the value returned by ec2-report-instance-status.
To report an instance's status, specify an instance ID with the INSTANCE parameter and a reason code
with the --reason parameter that applies to that instance. The following table contains descriptions of
all available reason codes.
Syntax
ec2-report-instance-status [instance_id ...] [[--filter name=value] ...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• The request ID
• A Boolean return value that indicates whether Amazon EC2 accepted the values.
Examples
Example Request
This example reports the current state of the instance as impaired.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ReportInstanceStatus
Related Commands
• ec2-describe-instance-status (p. 279)
ec2-request-spot-instances
Description
Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 starts on your behalf
when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets
the Spot Price based on available Spot Instance capacity and current Spot Instance requests. For more
information about Spot Instances, see Spot Instances in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-request-spot-instances ami_id --addressing addressing_type --price price
[--instance-count count] [--type type] [--valid-from timestamp] [--valid-until
timestamp] [--launch-group group] [--availability-zone-group group] [--user-data
data | --user-data-file data-file] [--group group [--group group ...]] [--key
key-pair] [--instance-type type] [--subnet subnet_id] [--availability-zone zone]
[--kernel kernel] [--ramdisk ramdisk] [--block-device-mapping mapping]
[--monitor] [--iam-profile arn|name]
Options
Name Description Required
-p, --price price The maximum hourly price for any Spot Instance Yes
launched to fulfill the request.
Type: String
Default: None
Example: -p .15
--ramdisk ramdisk The ID of the RAM disk to select. Some kernels require No
additional drivers at launch. Check the kernel
requirements for information on whether you need to
specify a RAM disk and search for the kernel ID.
Type: String
Default: None
Example: --ramdisk ari-badbad00
Note
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• Price
• Type (one-time or persistent)
• Product description (Linux/UNIX, Windows)
• State (active, open, closed, cancelled, failed)
• Create time
• Valid from
• Valid until
• Launch group
• Availability Zone group
• Image ID
• Instance type
• Key pair name
• Security group
• Monitoring status
Examples
Example Request
This example creates a Spot Instances request for three m1.small instances.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• RequestSpotInstances
Related Commands
• ec2-cancel-spot-instance-requests (p. 70)
• ec2-describe-spot-instance-requests (p. 363)
• ec2-describe-spot-price-history (p. 371)
ec2-reset-image-attribute
Description
Resets an attribute of an AMI to its default value.
Note
Syntax
ec2-reset-image-attribute ami_id -l
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example resets the launchPermission attribute.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ResetImageAttribute
Related Commands
• ec2-describe-image-attribute (p. 262)
• ec2-modify-image-attribute (p. 473)
ec2-reset-instance-attribute
Description
Resets an attribute of an instance to its default value. To reset the kernel or RAM disk, the instance must
be in a stopped state. To reset the SourceDestCheck, the instance can be either running or stopped.
The SourceDestCheck attribute exists to enable a Network Address Translation (NAT) instance in a
VPC to perform NAT. The attribute controls whether source/destination checking is enabled on the
instance. The default value is true, which means checking is enabled. The value must be false for the
instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud
User Guide.
Syntax
ec2-reset-instance-attribute instance_id { --kernel kernel_id | --ramdisk
ramdisk_id | --source-dest-check }
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example resets the kernel attribute.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ResetInstanceAttribute
Related Commands
• ec2-describe-instance-attribute (p. 274)
• ec2-modify-instance-attribute (p. 478)
ec2-reset-network-interface-attribute
Description
Resets a network interface attribute. You can specify only one attribute at a time.
Syntax
ec2-reset-network-interface-attribute NETWORKINTERFACE --source-dest-check
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the name of the network interface that was reset.
Examples
Example Request
This example resets network interface attributes for the specified network interface.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ResetNetworkInterfaceAttribute
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ResetNetworkInterfaceAttribute
Related Commands
• ec2-attach-network-interface (p. 37)
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interface-attribute (p. 314)
ec2-reset-snapshot-attribute
Description
Resets permission settings for the specified snapshot.
Syntax
ec2-reset-snapshot-attribute snapshot_id -c
Options
Name Description Required
-c, --crea Resets the create volume permissions of the snapshot. Yes
te-volume-permission Type: String
Default: None
Example: -c
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example resets the permissions for snap-78a54011, making it a private snapshot that can only be
used by the account that created it.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ResetSnapshotAttribute
Related Commands
• ec2-modify-snapshot-attribute (p. 487)
• ec2-describe-snapshot-attribute (p. 351)
• ec2-describe-snapshots (p. 354)
ec2-resume-import
Description
Resumes the upload of a disk image associated with an import instance or import volume task ID. Amazon
EC2 supports import of VMDK, RAW, and VHD disk images.
If the upload task stops without completing, use this command to resume this upload. The upload task
will resume from where it left off. For more information, see Using the Command Line Tools to Import
Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-resume-import -t task_id -o owner -w secret_key [-x days] [--user-threads
threads] [--part-size partsize] [--dry-run] [--dont-verify-format]
disk_image_filename
Options
Name Description Required
-w, --owner-sak The secret access key of the bucket owner. Yes
secret_access_key Type: String
Default: None
Example:
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
-x, --expires The validity period for the signed Amazon S3 URLs No
days that allow EC2 to access your file.
Type: String
Default: 30 days
Example: -x 10
--part-size partsize The size of each individual file part (in MB) that will be No
uploaded. The file will be split into multiple parts at
most as large as the partsize parameter.
Type: String
Default: 8
Example: --part-size 3
--dry-run Does not upload the file, only validates that the disk No
image matches a known type.
Type: None
Default: None
Example: --dry-run
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
Examples
Example Request
This example uploads the corresponding disk image of the Windows Server 2008 (32-bit) VM you want
to migrate.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• ResumeImport
Related Commands
• ec2-cancel-conversion-task (p. 63)
• ec2-delete-disk-image (p. 164)
ec2-revoke
Description
Removes a rule from a security group. The rule can be for ingress traffic, or for egress traffic (only if this
is a VPC security group).
This command applies to both EC2 security groups and VPC security groups. For information about VPC
security groups and how they differ from EC2 security groups, see Security Groups in the Amazon Virtual
Private Cloud User Guide.
The values that you specify in the revoke request (e.g., ports, etc.) must match the existing rule's values
in order for the rule to be removed.
Each rule consists of the protocol (e.g., TCP), plus either a CIDR range, or a source group (for ingress
rules) or destination group (for egress rules). For TCP and UDP, you must also specify the destination
port or port ranges. You can specify -1 to mean all ports (i.e., port range 0-65535). For ICMP, you must
also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes.
Permission changes are propagated to instances within the security group as quickly as possible. However,
a small delay might occur.
Syntax
ec2-revoke group [--egress] [-P protocol] (-p port_range | -t icmp_type_code)
[-u source_or_dest_group_owner ...] [-o source_or_dest_group ...] [-s
source_or_dest_cidr ...]
Options
Name Description Required
group For EC2 groups: The name or ID of the security group Yes
to modify.
For VPC groups: The ID of the security group to modify
(e.g., sg-1a2b3c4d).
The group must belong to your AWS account.
Type: String
Default: None
Example: websrv
-P, --protocol The name or number of the IP protocol to revoke (go Conditional
protocol to Protocol Numbers). EC2 security groups can have
rules only for TCP, UDP, and ICMP, whereas VPC
security groups can have rules assigned to any
protocol number.
When you call ec2-describe-group, the protocol
value returned is the number. Exception: For TCP,
UDP, and ICMP, the value returned is the name (e.g.,
tcp, udp, or icmp).
Type: String
Valid values for EC2 security groups: tcp | udp | icmp
or the corresponding protocol number (6 | 17 | 1).
Default for EC2 groups: Defaults to TCP if source
CIDR is specified (or implied by default), or all three
protocols (TCP, UDP, and ICMP) if source group is
specified (to ensure backwards compatibility).
Valid values for VPC groups: tcp | udp | icmp or any
protocol number (go to Protocol Numbers). Use all
to specify all protocols.
Condition: Required for VPC security groups.
Example: -P udp
-t icmp_type_code For ICMP: The ICMP type and code to revoke. This Conditional
must be specified in the format type:code where both
are integers. You can use -1 for the type or code to
mean all types or all codes.
Type: String
Default: None
Condition: Required if specifying icmp (or the
equivalent number) for the protocol.
Example: -t -1:-1
-u, The ID of the AWS account that owns the source Conditional
source_or_dest_group_owner security group (for ingress rules) or destination security
group (for egress rules). If the group is in your own
account, set this to your own AWS account ID. Cannot
be used when specifying a CIDR IP address.
Type: String
Default: None
Condition: Required when revoking a rule that gives
access to one or more source security groups.
Example: -u 111122223333
-s, --cidr The CIDR range. Cannot be used when specifying a Conditional
source_or_dest_cidr source or destination security group with the -o option.
Type: String
Default: 0.0.0.0/0
Constraints: Valid CIDR IP address range.
Condition: Required if revoking access to one or more
IP address ranges.
Example: -s 205.192.8.45/24
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example revokes TCP port 80 access from the 205.192.0.0/16 address range for the websrv security
group.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• RevokeSecurityGroupEgress
• RevokeSecurityGroupIngress
Related Commands
• ec2-authorize (p. 48)
• ec2-create-group (p. 84)
• ec2-delete-group (p. 168)
• ec2-describe-group (p. 256)
ec2-run-instances
Description
Launches a specified number of instances of an AMI for which you have permissions.
If Amazon EC2 cannot launch the minimum number of AMIs you request, no instances are launched. If
there is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches
the minimum number specified for each AMI and allocates the remaining available instances using round
robin.
Note
Every instance is launched in a security group (which you create using the ec2-create-group
command). If you don't specify a security group at launch time, the "default" security group is
used.
You can provide an optional key pair ID in the launch request (created using the ec2-create-keypair
or ec2-import-keypair command). The instances will have access to the 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.
The public key material is made available to the Linux 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.
Important
Launching public images without a key pair ID will leave them inaccessible.
You can provide optional user data in the launch request. All instances that collectively comprise the
launch request have access to this data. For more information, see Instance Metadata in the Amazon
Elastic Compute Cloud User Guide.
Note
If any of the AMIs have a product code attached for which the user has not subscribed, the
ec2-run-instances command will fail.
Syntax
ec2-run-instances ami_id [-n instance_count] [-g group [-g group ...]] [-k
keypair] [-d user_data |-f user_data_file] [--addressing addressing_type]
[--instance-type instance_type] [--availability-zone zone] [--kernel kernel_id]
[--ramdisk ramdisk_id] [--block-device-mapping block_device_mapping] [--monitor]
[--disable-api-termination] [--instance-initiated-shutdown-behavior behavior]
[--placement-group placement-group] [--tenancy tenancy] [--subnet subnet_id]
[--private-ip-address ip_address] [--client-token token] [--network-interface
networkinterface][--secondary-private-ip-address ip_address
|--secondary-private-ip-address-count count] [-p, --iam-profile arn|name]
Options
Name Description Required
-f, --user-data-file The file name of the user data to be made available No
filename to the instance(s) in this reservation.
Type: String
Default: None
Example: -f user-data.txt
--addressing Deprecated.
--kernel kernel The ID of the kernel with which to launch the instance. No
Type: String
Default: None
Example: --kernel aki-ba3adfd3
--ramdisk ramdisk The ID of the RAM disk to select. Some kernels require No
additional drivers at launch. Check the kernel
requirements for information on whether you need to
specify a RAM disk. To find kernel requirements, refer
to the Resource Center and search for the kernel ID.
Type: String
Default: None
Example: --ramdisk ari-abcdef01
Note
-p, --iam-profile The IAM instance profile to associate with the launched No
arn|name instance(s). IAM instance profiles enable you to
manage permissions for applications running on EC2.
This is either the Amazon Resource Name (ARN) of
the instance profile (e.g.,
arn:aws:iam::111111111111:instance-profile/s3access)
or the name of the role (e.g., s3access).
Type: String
Default: None
Example:
arn:aws:iam::111111111111:instance-profile/s3access
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Option Description
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example launches three instances of the ami-b232d0db AMI.
Example Request
This example launches an Amazon EBS-based Fedora image (ami-84db39ed) and provides a block
device mapping that mounts a public snapshot containing the 2000 US Census data.
Example Request
This example launches an instance with a primary IP address of 10.0.0.146 and two secondary private
IP addresses of 10.0.0.148 and of 10.0.0.150 in subnet-c53c87ac.
10.0.0.146 true
NICATTACHMENT eni-attach-6537fc0c 0 attaching 2012-07-01T14:45:27-
0700 true
GROUP sg-3f4b5653 default
PRIVATEIPADDRESS 10.0.0.146
PRIVATEIPADDRESS 10.0.0.148
PRIVATEIPADDRESS 10.0.0.150
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• RunInstances
Related Commands
• ec2-describe-instances (p. 285)
• ec2-stop-instances (p. 583)
• ec2-start-instances (p. 579)
• ec2-terminate-instances (p. 587)
• ec2-authorize (p. 48)
• ec2-revoke (p. 562)
• ec2-create-keypair (p. 99)
• ec2-create-group (p. 84)
• ec2-describe-group (p. 256)
ec2-start-instances
Description
Starts an instance that uses an Amazon EBS volume as its root device.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When
an instance is stopped, the compute resources are released and you are not billed for hourly instance
usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and
you are charged for Amazon EBS volume usage. You can restart your instance at any time. Each time
you transition an instance from stopped to started, we charge a full instance hour, even if transitions
happen multiple times within a single hour.
Note
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping
an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns
an error.
You cannot start or stop Spot Instances.
For more information, see Using Amazon EBS-Backed AMIs and Instances.
Syntax
ec2-start-instances instance_id [instance_id...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
• INSTANCE identifier
• Instance ID
• Previous state
• Current state
Examples
Example Request
This example starts the i-10a64379 instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• StartInstances
Related Commands
• ec2-describe-instances (p. 285)
• ec2-run-instances (p. 568)
• ec2-stop-instances (p. 583)
• ec2-terminate-instances (p. 587)
ec2-stop-instances
Description
Stops an instance that uses an Amazon EBS volume as its root device. Each time you transition an
instance from stopped to started, we charge a full instance hour, even if transitions happen multiple times
within a single hour.
Important
Although Spot Instances can use Amazon EBS-backed AMIs, they don't support Stop/Start. In
other words, you can't stop and start Spot Instances launched from an AMI with an Amazon EBS
root device.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When
an instance is stopped, the compute resources are released and you are not billed for hourly instance
usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and
you are charged for Amazon EBS volume usage. You can restart your instance at any time.
Note
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping
an instance does not preserve data stored in RAM.
Performing this operation on an instance that uses an instance store as its root device returns
an error.
You can stop, start, and terminate EBS-backed instances. You can only terminate S3-backed instances.
What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance,
the root device and any other devices attached to the instance persist. When you terminate an instance,
the root device and any other devices attached during the instance launch are automatically deleted. For
more information about the differences between stopping and terminating instances, go to the "Stop/Start"
and "Instance Termination" in Basics of Amazon EBS-Backed AMIS and Instances in the Amazon EC2
User Guide.
Syntax
ec2-stop-instances instance_id [instance_id...] [--force]
Options
Name Description Required
-f, --force Forces the instance to stop. The instance will not have No
an opportunity to flush file system caches or file system
metadata. If you use this option, you must perform file
system check and repair procedures. This option is
not recommended for Windows instances.
Type: Boolean
Default: None
Example: None
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example stops the i-10a64379 instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• StopInstances
Related Commands
• ec2-describe-instances (p. 285)
• ec2-run-instances (p. 568)
• ec2-start-instances (p. 579)
• ec2-terminate-instances (p. 587)
ec2-terminate-instances
Description
Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than
once, each call succeeds.
Terminated instances will remain visible after termination (approximately one hour).
Note
By default, Amazon EC2 deletes all Amazon EBS volumes that were attached when the instance
launched. Amazon EBS volumes attached after instance launch persist.
You can stop, start, and terminate EBS-backed instances. You can only terminate S3-backed instances.
What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance,
the root device and any other devices attached to the instance persist. When you terminate an instance,
the root device and any other devices attached during the instance launch are automatically deleted. For
more information about the differences between stopping and terminating instances, go to the "Stop/Start"
and "Instance Termination" in Basics of Amazon EBS-Backed AMIS and Instances in the Amazon EC2
User Guide.
Syntax
ec2-terminate-instances instance_id [instance_id ...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
Option Description
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example terminates the i-3ea74257 instance.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• TerminateInstances
Related Commands
• ec2-describe-instances (p. 285)
• ec2-run-instances (p. 568)
ec2-unassign-private-ip-addresses
Description
Unassigns one or more secondary private IP addresses from a network interface in Amazon VPC. This
command is only available in Amazon VPC.
Syntax
ec2-unassign-private-addresses --network-interface NetworkInterface
--secondary-private-ip-address IP ADDRESS [--secondary-private-ip-address IP
ADDRESS ...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
The command returns a true value if the operation succeeds or an error if the operation fails.
Examples
Example Request
This example unassigns the private IP addresses 10.0.0.118 and 10.0.0.119 from the network interface
specified.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• UnAssignPrivateIpAddresses
Related Commands
• ec2-assign-private-ip-addresses (p. 17)
ec2-unmonitor-instances
Description
Disables monitoring for a running instance. For more information, see Monitoring Your Instances and
Volumes in the Amazon Elastic Compute Cloud User Guide.
Syntax
ec2-unmonitor-instances instance_id [instance_id...]
Options
Name Description Required
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
Option Description
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Option Description
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns a table that contains the following information:
Examples
Example Request
This example disables monitoring for i-43a4412a and i-23a3397d.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Action
• UnmonitorInstances
Related Commands
• ec2-monitor-instances (p. 494)
• ec2-run-instances (p. 568)
ec2-upload-disk-image
Description
Deprecated. Uploads the disk image associated with an import instance or an import volume task ID.
Instead, use ec2-import-instance and ec2-import-volume commands to create the import task
and upload the image to Amazon EC2. ec2-import-instance and ec2-import-volume commands
that are part of Amazon EC2 API command line tools downloaded after 09-15-2011 are enhanced to
perform the task previously performed by ec2-upload-disk-image. Amazon EC2 supports import of
VMDK, RAW, and VHD disk images. For more information, see Using the Command Line Tools to Import
Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide.
If the upload task doesn't complete, use ec2-resume-import to resume the import from where it was
interrupted.
Syntax
ec2-upload-disk-image -t task_id -o owner -w secret_key [-x days] [--user-threads
threads] [--part-size partsize] [--dry-run] [--dont-verify-format] disk_image
Options
Name Description Required
disk_image The local file name of the disk image that you want to Yes
upload.
Type: String
Default: None
Example: WinSvr8-32-disk1.vmdk
-w, --owner-sak The secret access key of the bucket owner. Yes
secret_access_key Type: String
Default: None
Example:
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
-x, --expires The validity period for the signed Amazon S3 URLS No
days that allow EC2 to access your file.
Type: String
Default: 30 days
Example: -x 10
--part-size partsize The size of each individual file part (in MB) that will be No
uploaded. The file will be split into multiple parts at
most as large as the partsize parameter.
Type: String
Default: 8
Example: --part-size 3
--dry-run Does not upload the file, only validates that the disk No
image matches a known type.
Type: None
Default: None
Example: --dry-run
Common Options
Option Description
--region REGION Overrides the Region specified in the EC2_URL environment variable and
the URL specified by the -U option.
Default: The EC2_URL environment variable, or us-east-1 if the
environment variable is not set.
Example: --region eu-west-1
-U, --url URL URL is the uniform resource locator of the Amazon EC2 web service entry
point.
Default: The EC2_URL environment variable, or
https://ec2.amazonaws.com if the environment variable is not set.
Example: -U https://ec2.amazonaws.com
Option Description
-O, --aws-access-key The AWS access key ID associated with your account.
AWS_ACCESS_KEY Default: The value of the AWS_ACCESS_KEY environment variable.
Example: -O AKIAIOSFODNN7EXAMPLE
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-W, --aws-secret-key The secret access key associated with your Amazon account.
AWS_SECRET_KEY Default: The value of the AWS_SECRET_KEY environment variable.
Example: -W wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Note
Using the private key and X.509 certificate is still supported, but
we recommend using the access key and secret access key
going forward. For more information, see Deprecated Options
below.
-v, --verbose Displays verbose output by showing the API request and response on
the command line. This is particularly useful if you are building tools to
talk directly to our Query API.
Deprecated Options
For a limited time period, you can still use the private key and X.509 certificate in place of your AWS
access key and secret access key. However, we recommend that you start using the secret access key
and access key in your command line. After that time period elapses, the key and certificate will no longer
be supported.
Option Description
-K, --private-key The private key to use when constructing requests to Amazon EC2.
EC2-PRIVATE-KEY Default: The value of the EC2_PRIVATE_KEY environment variable.
Example: -K pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-C, --cert EC2-CERT The X.509 certificate to use when constructing requests to Amazon EC2.
Default: The value of the EC2_CERT environment variable.
Example: -C cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
Output
This command returns the following information:
Example
Example Request
This example uploads the corresponding disk image of the Windows Server 2008 (32-bit) VM you want
to migrate.
Related Topics
Download
• Getting Started with the Command Line Tools
Related Commands
• ec2-delete-disk-image (p. 164)
• ec2-import-instance (p. 451)
• ec2-import-volume (p. 462)
• ec2-resume-import (p. 557)
• ec2-cancel-conversion-task (p. 63)
• ec2-describe-conversion-tasks (p. 240)
Topics
• Common Options for AMI Tools (p. 601)
• ec2-bundle-image (p. 602)
• ec2-bundle-vol (p. 605)
• ec2-delete-bundle (p. 609)
• ec2-download-bundle (p. 611)
• ec2-migrate-bundle (p. 613)
• ec2-migrate-manifest (p. 616)
• ec2-unbundle (p. 618)
• ec2-upload-bundle (p. 620)
Note
The AMI Tools are only designed for use with the AMIs backed by Amazon S3.
Option Description
ec2-bundle-image
Description
Create a bundled AMI from an operating system image created in a loopback file. For more information,
go to the Amazon Elastic Compute Cloud User Guide.
Note
Scripts that require a copy of the public key from the launch key pair must obtain the key from
the instance's metadata (not the key file in the instance store) for instances bundled with the
2007-08-29 AMI tools and later. AMIs bundled before this release will continue to work normally.
Syntax
ec2-bundle-image -k private_key -c cert -u user_id -i image_path -r {i386 |
x86_64} [-d destination] [-p ami_prefix] [--ec2cert cert_path] [--kernel
kernel-id] [--ramdisk ramdisk_id] [--block-device-mapping block_device_mapping]
Options
Option Description Required
-k, --privatekey The path to the user's PEM-encoded RSA key file. Yes
private_key Example: -k
pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-c, --cert cert The user's PEM encoded RSA public key certificate Yes
file.
Example: -c
cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-u, --user user_id The user's AWS account ID without dashes. Do not Yes
use the Access Key ID.
Example: -u 111122223333
-r, --arch architecture Image architecture. If you don't provide this on the Yes
command line, you'll be prompted to provide it when
the bundling starts.
Valid Values: i386 | x86_64
Example: -r x86_64
-p, --prefix ami_prefix The filename prefix for bundled AMI files. No
Default: The name of the image file. For example, if
the image path is
/var/spool/my-image/version-2/debian.img,
then the default prefix is debian.img.
Example: -p my-image-is-special
--ec2cert cert_path The path to the Amazon EC2 X.509 public key No
certificate.
Default: /etc/ec2/amitools/cert-ec2.pem
(varies, depending on tools)
Example: --ec2cert
/etc/ec2/amiutil/cert-ec2.pem
Example: --block-device-mapping
ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3
Example: --block-device-mapping
ami=0,root=/dev/dsk/c0d0s0,ephemeral0=1
Output
Status messages describing the stages and status of the bundling process.
Example
This example creates a bundled AMI from an operating system image that was created in a loopback file.
Related Topics
• ec2-bundle-vol (p. 605)
• ec2-unbundle (p. 618)
• ec2-upload-bundle (p. 620)
• ec2-download-bundle (p. 611)
• ec2-delete-bundle (p. 609)
ec2-bundle-vol
Description
Creates a bundled AMI by compressing, encrypting and signing a snapshot of the local machine's root
file system.
To use ec2-bundle-vol, first you must install the AMI tools on the instance you are bundling, then run
ec2-bundle-vol on that instance, not on a local system. For information about getting the AMI tools,
go to Amazon EC2 AMI Tools.
Note
Scripts that require a copy of the public key from the launch key pair must obtain the key from
the instance's metadata (not the key file in the instance store) for instances bundled with the
2007-08-29 AMI tools and later. AMIs bundled before this release will continue to work normally.
On a running instance, Amazon EC2 attempts to inherit product codes, kernel settings, RAM
disk settings, and block device mappings with which the instance launched.
Syntax
ec2-bundle-vol -k private_key -u user_id -c cert -r architecture [-s size] [-d
destination] [-e exclude_directory_1,exclude_directory_1,...] [-p ami_prefix]
[-v volume] [--ec2cert cert_path] [--fstab fstab_path] [--generate-fstab]
[--kernel kernel-id] [--ramdisk ramdisk_id] [--block-device-mapping
block_device_mapping] [--[no-]inherit] [--productcodes product_code]
Options
Option Description Required
-k, --privatekey The path to the user's PEM-encoded RSA key file. Yes
private_key Example: -k
pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-u, --user user_id The user's AWS account ID without dashes. Do not Yes
use the Access Key ID.
Example: -u 111122223333
-c, --cert cert The user's PEM encoded RSA public key certificate Yes
file.
Example: -c
cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-r, --arch architecture Image architecture. If you don't provide this on the Yes
command line, you'll be prompted to provide it when
the bundling starts.
Valid Values: i386 | x86_64
Example: -r x86_64
-s, --size size The size, in MB (1024 * 1024 bytes), of the image file No
to create. The maximum size is 10240 MB.
Default: 10240
Example: -s 2048
-p, --prefix ami_prefix The filename prefix for bundled AMI files. No
Default: image
Example: -p my-image-is-special
-v, --volume volume The absolute path to the mounted volume from which No
to create the bundle.
Default: The root directory (/)
Example: -v /mnt/my-customized-ami
--ec2cert cert_path The path to the Amazon EC2 X.509 public key No
certificate.
Default: /etc/ec2/amitools/cert-ec2.pem
(varies, depending on tools)
Example: --ec2cert
/etc/ec2/amiutil/cert-ec2.pem
--fstab fstab_path The path to the fstab to bundle into the image. If this No
is not specified, Amazon EC2 bundles /etc/fstab.
Example: --fstab /etc/fstab
Example: --block-device-mapping
ami=sda1,root=/dev/sda1,ephemeral0=sda2,swap=sda3
Example: --block-device-mapping
ami=0,root=/dev/dsk/c0d0s0,ephemeral0=1
Output
Status messages describing the stages and status of the bundling.
Example
This example creates a bundled AMI by compressing, encrypting and signing a snapshot of the local
machine's root file system.
Splitting /mnt/image.gz.crypt...
Created image.part.00
Created image.part.01
Created image.part.02
Created image.part.03
...
Created image.part.22
Created image.part.23
Generating digests for each part...
Digests generated.
Creating bundle manifest...
Bundle Volume complete.
Related Topics
• ec2-bundle-image (p. 602)
• ec2-unbundle (p. 618)
• ec2-upload-bundle (p. 620)
• ec2-download-bundle (p. 611)
• ec2-delete-bundle (p. 609)
ec2-delete-bundle
Description
Deletes the specified bundle from Amazon S3 storage.
Syntax
ec2-delete-bundle -b s3_bucket -a access_key_id -s secret_key [-m manifest_path]
[-p ami_prefix] [--url url] [--retry] [-y] [--clear]
Options
Option Description Required
-b, --bucket The name of the Amazon S3 bucket containing the Yes
s3_bucket bundled AMI, followed by an optional '/'-delimited path
prefix
Example: -b myawsbucket/ami-001
-p, --prefix The bundled AMI filename prefix. Provide the entire Conditional
ami_prefix prefix. For example, if the prefix is image.img, use -p
image.img and not -p image.
Example: -p image.img
Condition: You must specify --prefix or
--manifest.
Output
Amazon EC2 displays status messages indicating the stages and status of the delete process.
Example
This example deletes a bundle from Amazon S3.
Related Topics
• ec2-bundle-image (p. 602)
• ec2-bundle-vol (p. 605)
• ec2-unbundle (p. 618)
• ec2-upload-bundle (p. 620)
• ec2-download-bundle (p. 611)
ec2-download-bundle
Description
Download the specified bundles from S3 storage.
Syntax
ec2-download-bundle -b s3_bucket [-m manifest] -a access_key_id -s secret_key
-k private_key [-p ami_prefix] [-d directory] [--retry] [--url url]
Options
Option Description Required
-b, --bucket The name of the Amazon S3 bucket where the bundle Yes
s3_bucket is located, followed by an optional '/'-delimited path
prefix.
Example: -b myawsbucket/ami-001
-k, --privatekey The private key used to decrypt the manifest. Yes
private_key Example: -k
pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-p, --prefix The filename prefix for the bundled AMI files. No
ami_prefix Default: image
Example: -p my-image
Output
Status messages indicating the various stages of the download process are displayed.
Example
This example creates the bundled directory and downloads the bundle from the myawsbucket Amazon
S3 bucket.
$ mkdir bundled
$ ec2-download-bundle -b myawsbucket -m fred.manifest.xml -a AKIAIOSFODNN7EXAMPLE
-s wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -k pk-HKZYKTAIG2ECMXY
IBH3HXV4ZBEXAMPLE.pem -d bundled
downloading manifest https://s3.amazonaws.com/myawsbucket/image.manifest.xml
to bundled/image.manifest.xml ...
downloading part https://s3.amazonaws.com/myawsbucket/image.part.00 to
bundled/image.part.00 ...
Downloaded image.part.00 from https://s3.amazonaws.com/myawsbucket.
downloading part https://s3.amazonaws.com/myawsbucket/image.part.01 to
bundled/image.part.01 ...
Downloaded image.part.01 from https://s3.amazonaws.com/myawsbucket.
downloading part https://s3.amazonaws.com/myawsbucket/image.part.02 to
bundled/image.part.02 ...
Downloaded image.part.02 from https://s3.amazonaws.com/myawsbucket.
downloading part https://s3.amazonaws.com/myawsbucket/image.part.03 to
bundled/image.part.03 ...
Downloaded image.part.03 from https://s3.amazonaws.com/myawsbucket.
downloading part https://s3.amazonaws.com/myawsbucket/image.part.04 to
bundled/image.part.04 ...
Downloaded image.part.04 from https://s3.amazonaws.com/myawsbucket.
downloading part https://s3.amazonaws.com/myawsbucket/image.part.05 to
bundled/image.part.05 ...
Downloaded image.part.05 from https://s3.amazonaws.com/myawsbucket.
downloading part https://s3.amazonaws.com/myawsbucket/image.part.06 to
bundled/image.part.06 ...
Downloaded image.part.06 from https://s3.amazonaws.com/myawsbucket.
Download Bundle complete.
Note
Related Topics
• ec2-bundle-image (p. 602)
• ec2-bundle-vol (p. 605)
• ec2-unbundle (p. 618)
• ec2-upload-bundle (p. 620)
• ec2-delete-bundle (p. 609)
ec2-migrate-bundle
Description
Copy a bundled AMI from one Region to another. For information on Regions, go to the Amazon Elastic
Compute Cloud User Guide.
Note
After copying a bundled AMI to a new Region, make sure to register it as a new AMI.
During migration, Amazon EC2 replaces the kernel and RAM disk in the manifest file with a
kernel and RAM disk designed for the destination Region. Unless the --no-mapping parameter
is given, ec2-migrate-bundle might use the Amazon EC2 DescribeRegions and
DescribeImages operations to perform automated mappings.
Syntax
ec2-migrate-bundle -k private_key -c cert -a access_key_id -s secret_key --bucket
source_s3_bucket --destination-bucket destination_s3_bucket --manifest
manifest_path [--location location] [--ec2cert ec2_cert_path] [--kernel
kernel-id] [--ramdisk ramdisk_id] [--no-mapping] [--region mapping_region_name]
Options
Option Description Required
-k, --privatekey The path to the user's PEM-encoded RSA key file. Yes
private_key Example: -k
pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-c, --cert cert The user's PEM encoded RSA public key certificate Yes
file.
Example: -c
cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-b, --bucket The source Amazon S3 bucket where the AMI is Yes
source_s3_bucket located, followed by an optional '/'-delimited path prefix.
Example: --bucket myawsbucket
-m, --manifest manifest The location of the Amazon S3 source manifest. Yes
Default: None
Example: --manifest my-ami.manifest.xml
--acl {public-read | The access control list policy of the bundled image. No
aws-exec-read} Valid Values: public-read | aws-exec-read
Default: aws-exec-read
Example: --acl public-read
Output
Status messages describing the stages and status of the bundling process.
Example
This example copies the AMI specified in the my-ami.manifest.xml manifest from the US to the EU.
Related Topics
• ec2-register (p. 504)
• ec2-run-instances (p. 568)
ec2-migrate-manifest
Description
Modify a bundled AMI to work in a new Region. For information on Regions, go to the Amazon Elastic
Compute Cloud User Guide.
You must use this command if you are bundling in one Region for use in another or if you copy a bundled
AMI out of band (without using ec2-migrate-bundle) and want to use it in a different Region.
Note
This command replaces the kernel and RAM disk in the manifest file with a kernel and RAM disk
designed for the destination Region.
Syntax
ec2-migrate-manifest -k private_key -c cert -m manifest_path {(-a access_key_id
-s secret_key --region mapping_region_name) | --no-mapping} [--kernel kernel-id]
[--ramdisk ramdisk_id] [--ec2cert ec2_cert_path]
Options
Option Description Required
-k, --privatekey The path to the user's PEM-encoded RSA key file. Yes
private_key Example: -k
pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
-c, --cert cert The user's PEM encoded RSA public key certificate Yes
file.
Example: -c
cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem
--mapping-url url Overrides the file containing kernel and RAM disk No
Region mappings from the specified hostname portion
of a URL.
Example: --mapping-url
mysite.com/eu-mappings
Output
Status messages describing the stages and status of the bundling process.
Example
This example copies the AMI specified in the my-ami.manifest.xml manifest from the US to the EU.
Backing up manifest...
Successfully migrated my-ami.manifest.xml It is now suitable for use in eu-west-
1.
Related Topics
• ec2-register (p. 504)
• ec2-run-instances (p. 568)
ec2-unbundle
Description
Recreates the AMI from the bundled AMI parts.
Syntax
ec2-unbundle -m manifest -k private_key [-d destination_directory] [-s
source_directory]
Options
Option Description Required
-m, --manifest manifest The path to the unencrypted AMI manifest file. Yes
Example: -m
/var/spool/my-first-bundle/Manifest
-k, --privatekey The path to your PEM-encoded RSA key file. Yes
private_key Example: -k $HOME/pk-234242example.pem
Example
This Linux and UNIX example unbundles the AMI specified in the fred.manifest.xml file.
$ mkdir unbundled
$ ec2-unbundle -m fred.manifest.xml -s bundled -d unbundled
$ ls -l unbundled
total 1025008
-rw-r--r-- 1 root root 1048578048 Aug 25 23:46 fred.img
Output
Status messages indicating the various stages of the unbundling process are displayed.
Related Topics
• ec2-bundle-image (p. 602)
• ec2-bundle-vol (p. 605)
• ec2-upload-bundle (p. 620)
• ec2-download-bundle (p. 611)
• ec2-delete-bundle (p. 609)
ec2-upload-bundle
Description
Upload a bundled AMI to Amazon S3 storage.
Syntax
ec2-upload-bundle -b s3_bucket -m manifest -a access_key_id -s secret_key [--acl
acl] [-d directory] [--part part] [--location location] [--url url] [--retry]
[--skipmanifest]
Options
Option Description Required
-b, --bucket The name of the Amazon S3 bucket in which to store Yes
s3_bucket the bundle, followed by an optional '/'-delimited path
prefix. If the bucket doesn't exist it will be created (if
the bucket name is available).
Example: -b myawsbucket/ami-001
-m, --manifest The path to the manifest file. The manifest file is Yes
manifest created during the bundling process and can be found
in the directory containing the bundle.
Example: -m image.manifest.xml
--acl acl The access control list policy of the bundled image. No
Valid Values: public-read | aws-exec-read
Default: aws-exec-read
Example: --acl public-read
--part part Starts uploading the specified part and all subsequent No
parts.
Example: --part 04
Output
Amazon EC2 displays status messages that indicate the stages and status of the upload process.
Example
This example uploads the bundle specified by the bundled/fred.manifest.xml manifest.
Uploaded fred.part.14
Uploading manifest ...
Uploaded manifest.
Bundle upload completed.
Related Topics
• ec2-bundle-image (p. 602)
• ec2-bundle-vol (p. 605)
• ec2-unbundle (p. 618)
• ec2-download-bundle (p. 611)
• ec2-delete-bundle (p. 609)
Document History
The following table describes the important changes since the last release of the Amazon EC2
documentation set.
Support for AWS Added support for AWS Marketplace AMIs and a new API 19 April 2012
Marketplace and a version: 2012-04-01.
New API Version
Amazon EBS Volume Starting with API version 2012-03-01, you can check the 18 April 2012
Status Check operational status of your Amazon EBS volume. The volume
status check gives you information about the I/O, also known
as read/write, capability of your EBS volumes. The volume
status check lets you know when an EBS volume’s data is
potentially inconsistent. Amazon Web Services (AWS) gives
you options to handle the potentially inconsistent volume. For
information on the commands related to this release, see:
Amazon EBS Volume Starting with API version 2012-03-01, you can check the 12 March 2012
Status Check operational status of your Amazon EBS volume. The volume
status check gives you information about the I/O, also known
as read/write, capability of your EBS volumes. The volume
status check lets you know when an EBS volume’s data is
potentially inconsistent. Amazon Web Services (AWS) gives
you options to handle the potentially inconsistent volume. For
information on the commands related to this release, see:
Instance Status Starting with API version 2011-12-15, you can use the 30 December
Checks ec2-describe-instance-status command to retrieve 2011
results of automated checks performed by Amazon EC2.These
status checks detect problems that may impair an instance’s
ability to run your applications. You can use
ec2-report-instance-status to send us feedback or
report an inaccurate instance status.
Elastic Network Starting with API version 2011-12-01, you can attach an elastic 21 December
Interfaces (ENIs) for network interface (ENI) to an EC2 instance in a VPC. For more 2011
Amazon EC2 information, see:
Instances in Amazon
Virtual Private Cloud • ec2-attach-network-interface (p. 37)
• ec2-detach-network-interface (p. 421)
• ec2-create-network-interface (p. 111)
• ec2-delete-network-interface (p. 185)
• ec2-describe-network-interfaces (p. 318)
• ec2-describe-network-interface-attribute (p. 314)
• ec2-modify-network-interface-attribute (p. 483)
• ec2-reset-network-interface-attribute (p. 549)
New Offering Types Starting with API version 2011-11-01, you can use the new 01 December
for Amazon EC2 offering-type parameter of 2011
Reserved Instances ec2-describe-reserved-instances-offerings to
identify the Reserved Instance offerings that address your
projected use: Heavy Utilization, Medium Utilization, and Light
Utilization. See
ec2-describe-reserved-instances-offerings (p. 339).
Support for Amazon The ec2-describe-instance-status (p. 279) command allows you 14 November
EC2 Instance Status to view the status of your instances and any upcoming 2011
scheduled events.
Support for Amazon The ec2-request-spot-instances (p. 533) command is updated 11 October
EC2 Spot Instances in with the subnet option, which enables you to specify an 2011
Amazon VPC Amazon VPC subnet into which to launch your Spot Instances.
Added common The common options table now appears in each command 18 September
options table to each description as well as on the existing Common Options for API 2011
entry Tools (p. 5) page.
• ec2-resume-import
• ec2-upload-disk-image
• ec2-import-instance
• ec2-import-volume.
Support for VHD file We've added VHD as one of the VM file formats supported for 24 August
format added to the import into Amazon EC2. See the API actions ImportInstance 2011
2011-07-15 API and ImportVolume, and the CLI commands ec2-import-instance
version and ec2-import-volume.
Spot Instances We've updated several actions that explain API changes for 26 May 2011
Availability Zone the Spot Instances Availability Zone pricing feature. We've
pricing changes also added new Availability Zone pricing options as part of the
information returned by Spot Instance Requests and Spot Price
History API calls.
Updates for the We've updated several existing actions for the 2011-05-15 API 26 May 2011
2011-05-15 API release.
Version
Dedicated Instances As part of the Dedicated Instances feature release, we've 27 March 2011
added new options related to the tenancy attribute of instances,
and the instance tenancy attribute of VPCs.
Updates for the We've updated several existing actions for the 2011-02-28 API 27 March 2011
2011-02-28 API release.
version
Updates for the We've added new actions and updated several existing actions 11 March 2011
2011-01-01 API for the 2011-01-01 API release. The new and updated actions
version are related to these Amazon VPC objects: Internet gateways,
route tables, network ACLs, VPC security groups, and VPC
Elastic IP addresses.
Merged Amazon VPC We've merged the Amazon VPC actions into this guide. 11 March 2011
Documentation
VM Import Added the following new actions, which allow you to import a 15 December
virtual machine or volume into Amazon EC2: 2010
Filters and Tags Added information about filters to many of the describe actions. 19 September
Added information about creating, describing, and deleting 2010
tags.
For more information about the commands for tags, see
ec2-create-tags (p. 137), ec2-delete-tags (p. 206), and
ec2-describe-tags (p. 381).
Placement Groups for Added information about placement groups, which you use 12 July 2010
Cluster Compute with cluster compute instances.
Instances For more information about the commands for placement
groups, see ec2-create-placement-group (p. 116),
ec2-describe-placement-groups (p. 325), and
ec2-delete-placement-group (p. 188).
Amazon VPC IP Amazon VPC users can now specify the IP address to assign 12 July 2010
Address Designation an instance launched in a VPC.
For information about the using the --private-ip-address
parameter with ec2-run-instances, see
ec2-run-instances (p. 568).
Security Group Clarified the information about authorizing security group 28 April 2010
Permissions permissions. For more information, see ec2-authorize (p. 48).
New Region Amazon EC2 now supports the Asia Pacific (Singapore) 28 April 2010
Region. The new endpoint for requests to this Region is
ec2.ap-southeast-1.amazonaws.com.
Clarification about Clarified that you can't stop and start Spot Instances that use 1 February
Spot Instances an Amazon EBS root device. For more information about 2010
stopping instances, see ec2-stop-instances (p. 583).
Spot Instances To support customers that use Amazon EC2 instances, but 14 December
have more flexible usage requirements (e.g., when instances 2009
run, how long they run, or whether usage completes within a
specific timeframe), Amazon EC2 now provides Spot Instances.
A Spot Instance is an instance that Amazon EC2 automatically
runs for you when its maximum price is greater than the Spot
Price. For conceptual information about Spot Instances, go to
the Amazon Elastic Compute Cloud User Guide.