Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

ModifyImageAttribute

Description

Modifies an attribute of an AMI.

Note

AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace product code cannot be made public.

Request Parameters

ImageId

The AMI ID.

Type: String

Default: None

Required: Yes

LaunchPermission.Add.n.UserId

Adds the specified AWS account ID to the AMI's list of launch permissions.

Type: String

Default: None

Required: No

LaunchPermission.Remove.n.UserId

Removes the specified AWS account ID from the AMI's list of launch permissions.

Type: String

Default: None

Required: No

LaunchPermission.Add.n.Group

Adds the specified group to the image's list of launch permissions. The only valid value is all.

Type: String

Valid value: all (for all EC2 users)

Default: None

Required: No

LaunchPermission.Remove.n.Group

Removes the specified group from the image's list of launch permissions. The only valid value is all.

Type: String

Valid value: all (for all EC2 users)

Default: None

Required: No

ProductCode.n

Adds the specified product code to the specified instance store-backed AMI. After you add a product code to an AMI, it can't be removed.

Type: String

Default: None

Required: No

Description.Value

Changes the AMI's description to the specified value.

Type: String

Default: None

Required: No

Response Elements

The following elements are returned in a ModifyImageAttributeResponse element.

requestId

The ID of the request.

Type: xsd:string

return

Returns true if the request succeeds. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

This example makes the AMI public (i.e., so any AWS account can launch it).

https://ec2.amazonaws.com/?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&LaunchPermission.Add.1.Group=all
&AUTHPARAMS

Example Request

This example makes the AMI private (i.e., so only you as the owner can launch it).

https://ec2.amazonaws.com/?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&LaunchPermission.Remove.1.Group=all
&AUTHPARAMS

Example Request

This example grants launch permission to the AWS account with ID 111122223333.

https://ec2.amazonaws.com/?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&LaunchPermission.Add.1.UserId=111122223333
&AUTHPARAMS

Example Request

This example removes launch permission from the AWS account with ID 111122223333.

https://ec2.amazonaws.com/?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&LaunchPermission.Remove.1.UserId=111122223333
&AUTHPARAMS

Example Request

This example adds the 774F4FF8 product code to the ami-61a54008 AMI.

https://ec2.amazonaws.com/?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&ProductCode.1=774F4FF8
&AUTHPARAMS

Example Request

This example changes the description of the AMI to New_Description

https://ec2.amazonaws.com/?Action=ModifyImageAttribute
&ImageId=ami-61a54008
&Description.Value=New_Description
&AUTHPARAMS

Example Response

<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
					<return>true</return>
					</ModifyImageAttributeResponse>