ModifyImageAttribute
The ModifyImageAttribute
operation modifies an
attribute of an AMI.
Attribute Name | Type | Description |
---|---|---|
launchPermission | List | Controls 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. |
productCodes | List | Associates 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 Name | Definition | Required? | Type |
---|---|---|---|
ImageId
|
AMI Id to modify an attribute on. | Yes |
string
|
Attribute
|
Specifies the attribute to modify. See the attributes table below for supported attributes. | Yes |
string
|
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 ProductCodes |
string
|
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 Name | Description | Supported Operations |
---|---|---|
launchPermission | Modifies the AMI's launch permissions. | add, remove |
productCodes | Attaches 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 Name | Definition | Type |
---|---|---|
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-01-03"> <return>true</return> </ModifyImageAttributeResponse>