ModifyImageAttribute

The ModifyImageAttribute operation modifies an attribute of an AMI.

Attribute NameTypeDescription
launchPermissionListControls who has permission to launch the AMI. Launch permissions can be granted to specific users by adding userIds. The AMI can be made public by adding the all group.
productCodesListAssociates product codes with AMIs. This allows a developer to charge a user extra for using the AMIs. productCodes is a write once attribute - once it has been set it can not be changed or removed.

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

Element NameDefinitionRequired?Type
ImageId AMI Id to modify an attribute on. Yesstring
Attribute Specifies the attribute to modify. See the attributes table below for supported attributes. Yesstring
OperationType Specifies the operation to perform on the attribute. See the attributes table below for supported operations for attributes. Currently only add and remove are supported. This parameter is not required for the ProductCodes attribute. Yes - Not for ProductCodesstring
UserId.n User ids to add to or remove from the launchPermission attribute. With launchPermission attribute string
UserGroup.n User groups to add to or remove from the launchPermission attribute. Currently, only the all group is available, specifiying all Amazon EC2 users. With launchPermission attribute string
ProductCode.n Attaches product codes to the AMI. Currently only one product code may be associated with an AMI. Once set, the product code can not be changed or reset. With productCodes attribute string
Attribute NameDescriptionSupported Operations
launchPermissionModifies the AMI's launch permissions.add, remove
productCodesAttaches a product code to the AMIs. The productCodes attribute is a write once attribute.operation not required

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

Element NameDefinitionType
return true if the operation succeeded, otherwise false. 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/2007-03-01">
  <return>true</return>
</ModifyImageAttributeResponse>