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. The user must be signed up for the product before they can launch the AMI. 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. Yesxsd:string
launchPermissionAdds or removes launch permissions for the AMI.Choiceec2:LaunchPermissionOperationType
productCodesAttaches 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.Choiceec2:ProductCodeItemType[]

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

Element NameDefinitionType
return true if the operation succeeded, otherwise false. xsd:boolean
<ModifyImageAttribute xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
  <imageId>ami-61a54008</imageId>
  <launchPermission>
    <add>
      <item>
        <group>all</group>
      </item>
      <item>
        <userId>495219933132</userId>
      </item>
    </add>
  <launchPermission>
</ModifyImageAttribute>
<ModifyImageAttribute xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
  <imageId>ami-61a54008</imageId>
  <productCodes>
    <item>
      <productCode>774F4FF8</productCode>
    </item>
  <productCodes>
</ModifyImageAttribute>
<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
  <return>true</return>
</ModifyImageAttributeResponse>