| Did this page help you? Yes No Tell us about it... |
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, go to Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide.
![]() | Note |
|---|---|
For Amazon EBS-backed instances, the |
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, go to 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.
The short version of this command is ec2reg.
ec2-register {[
manifest] -n
name [-a architecture] [-b mapping [...]] [-d
description] [-s snapshot_id] [--kernel
kernel_id] [--ramdisk ramdisk_id] [--root-device-name
name]}
| Name | Description | Required | |||
|---|---|---|---|---|---|
|
|
Full path to your AMI manifest in Amazon S3 storage. Type: String Default: None Condition: Required if registering an Amazon-S3 backed AMI. Example: mybucket/image.manifest.xml |
Conditional | |||
|
|
A name for your AMI. Type: String Default: None Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_) Example: -n "Standard Web Server" |
Yes | |||
|
|
The description of the AMI. Type: String Default: None Constraints: Up to 255 characters. Example: -d "Standard Web Server AMI" |
No | |||
|
|
The architecture of the image. Type: String Valid Values: Default: None Example: -a i386 |
No | |||
|
|
The ID of the kernel associated with the image. Type: String Default: None Example: --kernel aki-ba3adfd3 |
No | |||
|
|
The ID of the RAM disk to associate with the image. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, refer to the Resource Center and search for the kernel ID. Type: String Default: None Example: --ramdisk ari-badbad00 |
No | |||
|
|
The root device name (e.g., /dev/sda1, or xvda). Type: String Default: /dev/sda1 Condition: Required if registering an Amazon EBS-backed AMI. Example: --root-device-name /dev/sda1 |
No | |||
|
|
Defines a block device mapping for the instance. This argument is passed in the form of
You may specify multiple For more detailed information on block device mapping, go to Block Device Mapping in the Amazon Elastic Compute Cloud User Guide. Type: String Default: None Condition: If registering an Amazon EBS-backed AMI from a snapshot, you must at least specify this parameter with the root device name (e.g., /dev/sda1, or xvda), and the snapshot ID. Example: -b "/dev/sda1=snap-7eb96d16" |
Conditional | |||
|
|
The ID of the Amazon EBS snapshot to be used as the root device. Type: String Default: None Example: -s snap-78a54011 |
No |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
The command returns a table that contains the following information:
IMAGE identifier
Unique ID of the newly registered machine image
Amazon EC2 command line tools display errors on stderr.
This example registers the AMI specified in the image.manifest.xml manifest file, located in the bucket named
mybucket.
PROMPT>ec2-register mybucket/image.manifest.xml -n MyImageIMAGE ami-78a54011
This example registers an Amazon EBS snapshot to create an AMI backed by Amazon EBS.
PROMPT>ec2-register -n MyImage -s snap-65e34ab22IMAGE ami-78a54023
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.
PROMPT>ec2-register -n MyImage -s snap-6e3ad879 -b /dev/sdb=snap-823ea6df -b /dev/sdc=:100IMAGE ami-78a54043