| Did this page help you? Yes No Tell us about it... |
Modifies an attribute of an AMI.
The short version of this command is ec2mimatt.
ec2-modify-image-attribute
ami_id {-l (-a entity | -r entity) |
--product-code code}
| Name | Description | Required |
|---|---|---|
|
|
The AMI ID. Type: String Default: None Example: ami-2bb65342 |
Yes |
|
|
Product code to add to the specified Amazon S3-backed AMI. Once you add a product code to an AMI, it can't be removed. Type: String Default: None Example: -p D662E989 |
No |
|
|
Used with the --add or --remove flags to grant or revoke launch permissions. Type: String Default: None Example: --launch-permission |
Yes |
|
|
Adds a launch permission for the specified AWS account or for all accounts. Type: String Valid Values: Default: None Example: --launch-permission --add all |
Yes |
|
|
Removes a launch permission for the specified AWS account or for all users. Type: String Valid Values: Default: None Example: --launch-permission --remove all |
Yes |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
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 command line tools display errors on stderr.
This example makes the AMI public (i.e., so any AWS account can launch it).
PROMPT>ec2-modify-image-attribute ami-2bb65342 -l -a alllaunchPermission ami-2bb65342 ADD group all
This example makes the AMI private (i.e., so only you as the owner can launch it).
PROMPT>ec2-modify-image-attribute ami-2bb65342 -l -r alllaunchPermission ami-2bb65342 REMOVE group all
This example grants launch permission to the AWS account with ID 111122223333.
PROMPT>ec2-modify-image-attribute ami-2bb65342 -l -a 111122223333launchPermission ami-2bb65342 ADD userId 111122223333
This example removes launch permission from the AWS account with ID 111122223333.
PROMPT>ec2-modify-image-attribute ami-2bb65342 -l -r 111122223333launchPermission ami-2bb65342 REMOVE userId 111122223333
This example adds the 774F4FF8 product code to the ami-61a54008 AMI.
PROMPT>ec2-modify-image-attribute ami-61a54008 -p 774F4FF8productcodes ami-61a54008 productCode 774F4FF8