ModifyImageAttribute

The ModifyImageAttribute operation modifies an attribute of an AMI.

Currently the only attribute supported is launchPermission. By modifying this attribute it is possible to make an AMI public or to grant specific users launch permissions for the AMI. To make the AMI public add the group=all attribute item. To grant launch permissions for a specific user add a userId=<userid> attribute item.

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. Currently, only launchPermission is supported. Yesstring
OperationType Specifies the operation to perform on the attribute. Currently only add and remove are supported. Yesstring
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

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
&UserGroup.1=all
&UserId.1=495219933132
&...auth parameters...
<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2007-01-19">
  <return>true</return>
</ModifyImageAttributeResponse>