Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time.
To specify the attribute, you can use theAttribute parameter, or one of the following parameters:Description,ImdsSupport, orLaunchPermission.
Images with an AWS Marketplace product code cannot be made public.
To enable the SriovNetSupport enhanced networking attribute of an image, enable SriovNetSupport on an instance and create an AMI from the instance.
The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, seeCommon Query Parameters.
The name of the attribute to modify.
Valid values:description |imdsSupport |launchPermission
Type: String
Required: No
A new description for the AMI.
Type:AttributeValue object
Required: No
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response isDryRunOperation. Otherwise, it isUnauthorizedOperation.
Type: Boolean
Required: No
The ID of the AMI.
Type: String
Required: Yes
Set tov2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will haveHttpTokens automatically set torequired so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition,HttpPutResponseHopLimit is set to2. For more information, seeConfigure the AMI in theAmazon EC2 User Guide.
Do not use this parameter unless your AMI software supports IMDSv2. After you set the value tov2.0, you can't undo it. The only way to “reset” your AMI is to create a new AMI from the underlying snapshot.
Type:AttributeValue object
Required: No
A new launch permission for the AMI.
Type:LaunchPermissionModifications object
Required: No
The operation type. This parameter can be used only when theAttribute parameter islaunchPermission.
Type: String
Valid Values:add | remove
Required: No
The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when theAttribute parameter islaunchPermission.
Type: Array of strings
Required: No
The Amazon Resource Name (ARN) of an organization. This parameter can be used only when theAttribute parameter islaunchPermission.
Type: Array of strings
Required: No
Not supported.
Type: Array of strings
Required: No
The user groups. This parameter can be used only when theAttribute parameter islaunchPermission.
Type: Array of strings
Required: No
The AWS account IDs. This parameter can be used only when theAttribute parameter islaunchPermission.
Type: Array of strings
Required: No
The value of the attribute being modified. This parameter can be used only when theAttribute parameter isdescription orimdsSupport.
Type: String
Required: No
The following elements are returned by the service.
The ID of the request.
Type: String
Istrue if the request succeeds, and an error otherwise.
Type: Boolean
For information about the errors that are common to all actions, seeCommon client error codes.
This example makes the AMI public (for example, so any AWS account can use it).
https://ec2.amazonaws.com/?Action=ModifyImageAttribute&ImageId=ami-61a54008&LaunchPermission.Add.1.Group=all&AUTHPARAMS<ModifyImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <return>true</return></ModifyImageAttributeResponse>This example makes the AMI private (for example, so that only you as the owner can use it).
https://ec2.amazonaws.com/?Action=ModifyImageAttribute&ImageId=ami-61a54008&LaunchPermission.Remove.1.Group=all&AUTHPARAMSThis example grants launch permission to the AWS account with ID111122223333.
https://ec2.amazonaws.com/?Action=ModifyImageAttribute&ImageId=ami-61a54008&LaunchPermission.Add.1.UserId=111122223333&AUTHPARAMSThis example adds the774F4FF8 product code to theami-61a54008 AMI.
https://ec2.amazonaws.com/?Action=ModifyImageAttribute&ImageId=ami-61a54008&ProductCode.1=774F4FF8&AUTHPARAMSThis example changes the description of the AMI toNew Description.
https://ec2.amazonaws.com/?Action=ModifyImageAttribute&ImageId=ami-61a54008&Description.Value=New Description&AUTHPARAMSThis example sets the AMI to IMDSv2 only. Instances created from this AMI will require that IMDSv2 is used when requesting instance metadata.
Note that after you set the value tov2.0, you can't undo it.
https://ec2.amazonaws.com/?Action=ModifyImageAttribute&ImageId=ami-61a54008&ImdsSupport.Value=v2.0&AUTHPARAMSFor more information about using this API in one of the language-specific AWS SDKs, see the following: