Registers an AMI with Amazon EC2. Images must be registered before they can be launched. To
launch instances, use the RunInstances operation.
Each AMI is associated with an unique ID which is provided by the Amazon EC2 service through this operation. If needed, you can deregister an AMI at any time.
![]() | Note |
|---|---|
AMIs backed by Amazon EBS are automatically registered when you create the image. However, you can use this to register a snapshot of an instance backed by Amazon EBS. Amazon EBS snapshots are not guaranteed to be bootable. For information on creating AMIs backed by Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide. Any modifications to an AMI backed by Amazon S3 invalidates this registration. If you make changes to an image, deregister the previous image and register the new image. |
ec2-register
[
manifest] -n name [-a
architecture] [-b mapping [-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 Example: mybucket/image.manifest.xml |
No |
|
|
The name of the AMI that was provided during image creation. Type: String Default: None Constraints: 3-128 alphanumeric characters, parenthesis (()), commas (,), slashes (/), dashes (-), or underscores(_) Example: Standard Web Server |
No |
|
|
The description of the AMI. Type: String Default: None Constraints: Up to 255 characters. Example: Standard Web Server AMI |
No |
|
|
The architecture of the image. Type: String Valid Values: Default: None Example: |
No |
|
|
The ID of the kernel to select. Type: String Default: None Example: aki-ba3adfd3 |
No |
|
|
The ID of the RAM disk to select. 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: ari-badbad00 |
No |
|
|
The root device name (e.g., /dev/sda1). Type: String Default: None Example: |
No |
|
|
The device name (e.g., /dev/sdh). Type: String Default: None Example: /dev/sdh |
No |
|
|
The virtual device name. Type: String Default: None Example: |
No |
|
|
The ID of the snapshot. Type: String Default: None Example: snap-78a54011 |
No |
|
|
The size of the volume, in GiBs. Required if you are not creating a volume from a snapshot. Type: Integer Default: None Example: 10 |
No |
|
|
Specifies whether the Amazon EBS volume is deleted on instance termination. Type: Boolean Default: true Example: --delete-on-termination |
No |
The command returns a table that contains the following information:
IMAGE identifier
Unique ID of the newly registered machine image
Amazon EC2 displays errors on stderr.
This example registers the AMI specified in the image.manifest.xml manifest
file.
PROMPT>ec2-register mybucket/image.manifest.xmlIMAGE 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