ec2-modify-image-attribute ami_id -l (-a item_value | -r item_value)
ec2-modify-image-attribute ami_id
-p product_code
[-p product_code ...]
Modifies an attribute for the specified AMI.
| Attribute Name | Type | Description | |||
|---|---|---|---|---|---|
|
|
List |
Controls who has permission to launch the AMI. You can grant launch permissions
by adding user IDs or make the AMI public by adding the
|
|||
|
|
List |
Associates a product code with an AMI. This allows a developer to charge a user for using the AMI.
The product code attribute is a write-once attribute. After a product code is set for an AMI it cannot be altered or removed. AMIs are limited to one product code. |
| Option | Description | Required |
|---|---|---|
|
|
Modifies the Example: |
Yes |
|
|
Adds or removes an attribute item. The type of the item is inferred
from the item value. For
Example: |
Yes |
|
|
Sets the Example: |
Yes |
Amazon EC2 returns a table that contains the following information:
-
Attribute type identifier.
-
ID of the AMI on which attributes are being modified.
-
Action performed on the attribute.
-
Attribute or attribute list item value type.
-
Attribute or attribute list item value.
Amazon EC2 displays errors on stderr.
The following example modifies launch permission attributes
for the ami-2bb65342 AMI:
$ec2-modify-image-attribute ami-2bb65342 -l -a 495219933132launchPermission ami-2bb65342 ADD userId 495219933132
The following example adds the 774F4FF8 product code
to the ami-2bb65342 AMI:
$ec2-modify-image-attribute ami-2bb65342 -p 774F4FF8productCodes ami-2bb65342 productCode 774F4FF8
![[Note]](note.png)