ModifyImageAttribute

The ModifyImageAttribute operation modifies an attribute of an AMI.

Attribute NameTypeDescription

launchPermission

List

Controls who has permission to launch the AMI. Launch permissions can be granted to specific users by adding userIds. To make the AMI public, add the all group.

productCodes

List

Associates a product code with AMIs. This allows developers to charge users for using AMIs. The user must be signed up for the product before they can launch the AMI. This is a write once attribute; after it is set, it cannot be changed or removed.

The following table describes the request parameters for ModifyImageAttribute. Parameter names are case sensitive.

NameDescriptionRequired

ImageId

AMI ID to modify.

Type: String

Yes

Attribute

Specifies the attribute to modify. See the preceding attributes table for supported attributes.

Type: String

Yes

OperationType

Specifies the operation to perform on the attribute. See the preceding attributes table for supported operations for attributes.

Type: String

Valid Values: add | remove

Condition: Required for launchPermission

Conditional

UserId.n

User IDs to add to or remove from the launchPermission attribute.

Type: String

Condition: Required for launchPermission

Conditional

UserGroup.n

User groups to add to or remove from the launchPermission attribute. Currently, the all group is available, which will make it a public AMI.

Type: String

Condition: Required for launchPermission

Conditional

ProductCode.n

Attaches a product code to the AMI. Currently only one product code can be associated with an AMI. Once set, the product code cannot be changed or reset.

Type: String

Condition: Required for productCodes

Conditional

The following table describes the default response tags included in ModifyImageAttribute responses.

NameDescription

return

true if the operation succeeded, otherwise false.

Type: xsd:boolean

https://ec2.amazonaws.com/
?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&Attribute=launchPermission
&OperationType=add
&Group.1=all
&UserId.1=495219933132
&...auth parameters...
https://ec2.amazonaws.com/
?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&Attribute=productCodes
&ProductCode.1=774F4FF8
&...auth parameters...
<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2008-02-01">
  <return>true</return>
</ModifyImageAttributeResponse>