aws ec2 describe-image-attribute
Describes the specified attribute of the specified AMI. AWS CLI reference
2 examples 3 options Its page in the AWS CLI reference
Examples
Example 1: To describe the launch permissions for an AMI
The following describe-image-attribute example describes the launch permissions for the specified AMI.
aws ec2 describe-image-attribute --image-id ami-5731123e --attribute launchPermissionIdentify--image-idThe ID of the AMI.--attributeThe AMI attribute.Its output
{
"LaunchPermissions": [
{
"UserId": "123456789012"
}
],
"ImageId": "ami-5731123e"
}For more information, see Share an AMI with specific AWS accounts in the Amazon EC2 User Guide.
Example 2: To describe the product codes for an AMI
The following describe-image-attribute example describes the product codes for the specified AMI. Note that this AMI has no product codes.
aws ec2 describe-image-attribute --image-id ami-5731123e --attribute productCodesIdentify--image-idThe ID of the AMI.--attributeThe AMI attribute.Its output
{
"ProductCodes": [],
"ImageId": "ami-5731123e"
}For more information, see Paid AMIs in the AWS Marketplace for Amazon EC2 instances in the Amazon EC2 User Guide.
Options
--attributeThe AMI attribute.--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--image-idThe ID of the AMI.