aws ec2 describe-instance-image-metadata
Describes the AMI that was used to launch an instance, even if the AMI is deprecated, deregistered, made private (no longer public or shared with your account), or not allowed. AWS CLI reference
5 options Its page in the AWS CLI reference
Options
--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--filtersThe filters.--instance-idsThe instance IDs.--max-resultsThe maximum number of items to return for this request.--next-tokenThe token returned from a previous paginated request.