ec2-modify-image-attribute

ec2-modify-image-attribute AMI -l (-a ITEM_VALUE | -r ITEM_VALUE)

ec2-modify-image-attribute AMI -p PRODUCT_CODE [-p PRODUCT_CODE ...]

Modifies an attribute for the specified AMI.

Attribute NameTypeDescription
launchPermissionListControls who has permission to launch the AMI. You can grant launch permissions by adding user IDs or make the AMI public by adding the all group. To learn more about sharing AMIs see the section called “Sharing AMIs”.
[Note]Note

If another user launches your AMI there is no mechanism to prevent that user from rebundling the image and registering it as a new AMI.

productCodesList

Associates product codes with an AMI. This allows a developer to charge a user for using the AMI.

[Note]Note

The user must be signed up for the product before they can launch the AMI.

The product code attribute is a write once attribute. After a product code is set for an AMI it can not be altered or removed.

AMIs are currently limited to one product code.

A table containing the following information is returned:

Errors are displayed on stderr.

OptionDefinitionRequired?Example
-lModifies the launchPermission property.Yes-l
-a ITEM_VALUE | -r ITEM_VALUE Adds or removes an attribute item. The value of the item is ITEM_VALUE. The type of the item is inferred from the item value. For launchPermission there are two item types:
  • group: The only group currently supported is the all group. Adding this group sets public launch permissions for the AMI.

  • userId: UserId must be in the form of an AWS account id. Adding userId items grants explicit launch permissions to that user for the AMI.

Yes-a all
-p PRODUCT_CODESets the productCodes property.Yes-p 774F4FF8
$ ec2-modify-image-attribute ami-5bae4b32 -l -a 495219933132
launchPermission ami-5bae4b32 ADD userId 495219933132
$ ec2-modify-image-attribute ami-5bae4b32 -p 774F4FF8
productCodes ami-5bae4b32     productCode 774F4FF8