ModifyImageAttribute
Description
Modifies an attribute of an AMI.
Request Parameters
Name | Description | Required |
---|---|---|
|
Type: |
Ancestor: None
Children: imageId
, launchPermission
, and productCodes
imageId
The AMI ID.
Type: xsd:string
Default: None
Ancestor: ModifyImageAttributeType
Children: None
Yes
launchPermission
Launch permission set.
Type: LaunchPermissionOperationType
Ancestor: ModifyImageAttributeType
Children: add
, remove
add
Items to add.
Type: LaunchPermissionListType
Ancestor: launchPermission
Children: item
item
Information for launch permissions.
Type: LaunchPermissionItemType
Ancestor: add
Children: userId
, group
userId
User IDs associated with the launchPermission attribute.
Type: xsd:string
Default: None
Ancestor: item
Children: None
group
Security groups associated with the launchPermission attribute. You can specify the "all" group, which will make it a public AMI.
Type: xsd:string
Default: None
Ancestor: item
Children: None
remove
Items to remove.
Type: LaunchPermissionListType
Ancestor: launchPermission
Children: item
item
Information for launch permissions.
Type: LaunchPermissionItemType
Ancestor: remove
Children: userId
, group
userId
User IDs associated with the launchPermission attribute.
Type: xsd:string
Default: None
Ancestor: item
Children: None
group
Security groups associated with the launchPermission attribute. You can specify the "all" group, which will make it a public AMI.
Type: xsd:string
Default: None
Ancestor: item
Children: None
productCodes
Product code set.
Type: ProductCodeListType
Ancestor: ModifyImageAttributeType
Children: item
item
Information for one product code.
Type: ProductCodeItemType
Ancestor: productCodes
Children: productCode
productCode
Amazon DevPay product code. Currently only one product code can be associated with an AMI. Once set, the product code cannot be changed or reset.
Type: xsd:string
Default: None
Ancestor: item
Children: None
Response Elements
Name | Description |
---|---|
|
Type: ModifyImageAttributeResponseType Ancestor: None Children: |
|
The ID of the request. Type: xsd:string Ancestor: Children: None |
|
Returns "true" if successful; otherwise "false". Type: xsd:boolean Ancestor: Children: None |
Examples
Example Request
This example makes this a public AMI and grants specific permissions to a user.
<ModifyImageAttribute xmlns="http://ec2.amazonaws.com/doc/2009-07-15/"> <imageId>ami-61a54008</imageId> <launchPermission> <add> <item> <group>all</group> </item> <item> <userId>495219933132</userId> </item> </add> <launchPermission> </ModifyImageAttribute>
Example Response
<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2009-07-15/"> <return>true</return> </ModifyImageAttributeResponse>
Example Request
The following example adds the 774F4FF8
product code to the ami-2bb65342
AMI:
<ModifyImageAttribute xmlns="http://ec2.amazonaws.com/doc/2009-07-15/"> <imageId>ami-61a54008</imageId> <productCodes> <item> <productCode>774F4FF8</productCode> </item> <productCodes> </ModifyImageAttribute>
Example Response
<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2009-07-15/"> <return>true</return> </ModifyImageAttributeResponse>