Amazon EC2 Quick Reference Card
Amazon EC2 Quick Reference Card
Revised: 8/3/2011
ec2-terminate-instances (ec2kill)
Terminates the specified instance. ec2-terminate-instances instance_id [instance_id ...]
ec2-stop-instances (ec2stop)
Stops an instance (applies only to Amazon EBS-backed instances). ec2-stop-instances instance_id [instance_id ...]
ec2-start-instances (ec2start)
Starts a stopped instance (applies only to Amazon EBSbacked instances). ec2-start-instances instance_id [instance_id ...]
ec2-monitor-instances (ec2min)
Enables monitoring for the specified instance. ec2-monitor-instances instance-id [instance_id ...]
ec2-describe-instance-attribute (ec2dinatt)
Describes an attribute for the specified instance. ec2-describe-instance-attribute instance_id { -block-device-mapping | --disable-apitermination | --instance-initiated-shutdownbehavior | --instance-type | --kernel | -ramdisk | --root-device-name | --user-data }
ec2-unmonitor-instances (ec2umin)
Disables monitoring for the specified instance(s). ec2-monitor-instances instance-id [instance_id ...]
ec2-describe-instances (ec2din)
Lists the specified instances. If no instance is specified, all your instances are listed. ec2-describe-instances [instance_id ...] [[--filter name=value] ...]
ec2-create-snapshot (ec2addsnap)
Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. ec2-create-snapshot volume_id
ec2-describe-addresses (ec2daddr)
Lists both EC2 and VPC Elastic IP addresses assigned to your account. ec2-describe-addresses [ip_address ...]
ec2-describe-volumes (ec2dvol)
Lists the specified Amazon EBS volumes. If no volume is specified, all your volumes are listed. ec2-describe-volumes [volume_id ...] [[--filter name=value] ...]
ec2-describe-snapshots (ec2dsnap)
Lists the specified snapshots. If no snapshot is specified, all your snapshots are listed. ec2-describe-snapshots [snapshot_id ...] [[--filter name=value] ...]
ec2-release-address (ec2reladdr)
Releases an EC2 Elastic IP address associated with your account. ec2-release-address ip_address
ec2-associate-address (ec2assocaddr)
Associates an EC2 Elastic IP address with an instance. If the IP address is currently assigned to another instance, the IP address is reassigned to the specified instance. ec2-associate-address ip_address -i instance_id
ec2-delete-volume (ec2delvol)
Deletes the specified Amazon EBS volume. ec2-delete-volume volume_id
ec2-delete-snapshot (ec2delsnap)
Deletes the specified Amazon EBS snapshot. ec2-delete-snapshot snapshot_id
ec2-attach-volume (ec2attvol)
Attaches an Amazon EBS volume to a running instance and exposes it as the specified device. The volume and instance must be in the same Availability Zone. ec2-attach-volume volume_id -i instance_id -d device
ec2-detach-volume (ec2detvol)
Detaches an Amazon EBS volume from an instance. ec2-detach-volume volume_id [-i instance_id [-d device]] [--force]
ec2-disassociate-address (ec2disaddr)
ec2-disassociate-address ip_address
Disassociates the specified EC2 Elastic IP address from the instance to which it is assigned.
Revised: 8/3/2011
Tagging Tools
ec2-create-tags (ec2addtag)
Adds or overwrites one or more tags for the specified resource or resources. Each tag consists of a key and an optional value. Tag keys must be unique per resource. ec2-create-tags resource_id [resource_id ...] --tag key[=value] [--tag key[=value] ...]
ec2-describe-keypairs (ec2dkey)
Lists the specified key pairs. If no key pair is specified, all your key pairs are listed. ec2-describe-keypairs [key_pair ...]
ec2-create-image (ec2cim)
Creates an AMI that uses an Amazon EBS root device from a running or stopped Amazon EBS-backed instance. ec2-create-image instance_id --name name [ --description description] [ --no-reboot]
ec2-delete-tags (ec2deltag)
Removes a set of tags from a set of resources. The tag value is not required. ec2-delete-tags resource_id [resource_id ...] --tag key[=value] [--tag key[=value] ...]
ec2-delete-keypair (ec2delkey)
Deletes the specified key pair by removing the public key from Amazon EC2. ec2-delete-keypair key_pair
ec2-describe-image-attribute (ec2dimatt)
Describes an attribute for the specified AMI. ec2-describe-image-attribute ami_id { --launchpermission | --product-code | --block-devicemapping | --kernel | --ramdisk }
ec2-import-keypair (ec2ikey)
Imports the public key for a key pair. You keep the private key. The key pair works in all EC2 Regions. ec2-import-keypair key_pair --public-key-file file
ec2-describe-tags (ec2dtag)
Lists your tags. You can filter the list to return only tags you specify. ec2-describe-tags [[--filter name=value] ...]
ec2-register (ec2reg)
Registers the AMI specified in the manifest file and generates a new AMI ID. ec2-register manifest
Other Tools
ec2-get-console-output (ec2gcons)
Retrieves console output for the specified instance. ec2-get-console-output instance_id [--raw-console-output]
ec2-delete-group (ec2delgrp)
Deletes the specified EC2 security group. ec2-delete-group ec2_group_name_or_id
Windows Tools
ec2-get-password (ec2gpass)
Retrieves and decrypts the administrator password for the specified Windows instance. ec2-get-password instance_id -k key_pair
ec2-describe-group (ec2dgrp)
Lists your EC2 and VPC security groups. If no security group is specified, all your security groups are listed. ec2-describe-group [ec2_group_name_or_id ... | vpc_group_id ...] [[--filter name=value] ...]
ec2-authorize (ec2auth)
Adds a rule to an EC2 security group. ec2-authorize ec2_group_name_or_id [-P protocol] [-p port_range | -t icmp_type_code] [-u source_group_owner] [-o source_group ...] [-s source_cidr ...]
This Amazon Elastic Compute Cloud Quick Reference Card contains commonly used commands and options. For complete reference information, see the Amazon EC2 Command Line Reference at http:// aws.amazon.com/documentation/ec2/.
ec2-bundle-instance (ec2bundle)
Bundles an Amazon S3-backed Windows instance. ec2-bundle-instance instance_id -b bucket -p prefix -o access_key_id {-c policy | -s policy_signature | -w secret_access_key}