ec2-modify-image-attribute

Description

Modifies an attribute of an AMI.

Syntax

ec2-modify-image-attribute ami_id {-l (-a entity | -r entity) | --product-code code}

Options

NameDescriptionRequired

ami_id

The AMI ID.

Type: String

Default: None

Example: ami-2bb65342

Yes

--product-code code

Product code.

Type: String

Default: None

Example: D662E989

No

--launch-permission

Used with the --add or --remove flags to grant or revoke launch permissions.

Type: String

Default: None

Example: --launch-permission

Yes

--add entity

Adds a launch permission for the specified AWS account or for all users.

Type: String

Valid Values: AWS account identifier | all

Default: None

Example: --launch-permission --add all

Yes

--remove entity

Removes a launch permission for the specified AWS account or for all users.

Type: String

Valid Values: AWS account identifier | all

Default: None

Example: --launch-permission --remove all

Yes

Output

The command returns a table that contains the following information:

  • Attribute type identifier

  • ID of the AMI on which attributes are being modified

  • Action performed on the attribute

  • Attribute or attribute list item value type

  • Attribute or attribute list item value

Amazon EC2 displays errors on stderr.

Examples

Example Request

This example makes this a public AMI and grants specific permissions to a user.

PROMPT> ec2-modify-image-attribute ami-2bb65342 -l -a AIDADH4IGTRXXKCD
launchPermission ami-2bb65342 ADD userId
							AIDADH4IGTRXXKCD

Example Request

The following example adds the 774F4FF8 product code to the ami-2bb65342 AMI:

PROMPT> ec2-modify-image-attribute ami-2bb65342 -p 774F4FF8
productCodes ami-2bb65342 productCode
							774F4FF8