CentOS publishes their AMI product codes to their wiki. The wiki provides the following information for the latest CentOS 7 AMI:

  • Owner: aws-marketplace
  • Product Code: aw0evgkw8e5c1q413zgy5pjce

Using this information, we can query describe-images with the AWS CLI:

Example:

aws ec2 describe-images \
    --owners 'aws-marketplace' \
    --filters 'Name=product-code,Values=aw0evgkw8e5c1q413zgy5pjce' \
    --query 'sort_by(Images, &CreationDate)[-1].[ImageId]' \
    --output 'text'

Output:

ami-6d1c2007

This query returns a single AMI ID, selected by sorting the collection by creation date and then selecting the last (most recent) element in the collection.

Per the CentOS wiki, multiple AMI ids may be associated with a product key, so while this query would currently only return a single AMI because only one matching this product currently exists... in the future if a new AMI is created for this product code for any reason this query will return it instead.

Answer from Anthony Neace on Stack Overflow
🌐
GitHub
gist.github.com › magnetikonline › e822a78a9b691d86d6e45626f8f0c977
List AWS AMI IDs for a given marketplace product URL. · GitHub
Browse the AWS marketplace to locate the product of interest. Note the URL of the product page. ... $ ./listmarketplaceami.sh ap-southeast-2 "https://aws.amazon.com/marketplace/pp/B00UU272MM" # ami-07b6ae8cccab5644b:2020-08-24T18:38:46.000Z:NGINX Plus - Amazon Linux AMI (HVM, v1.4), provided by Nginx, Inc. https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html · https://blog.gruntwork.io/locating-aws-ami-owner-id-and-image-name-for-packer-builds-7616fe46b49a
Discussions

amazon web services - How am I supposed to get the owner id of an aws market place ami? - Stack Overflow
Of course, replace the region and AMI ID as appropriate. If you'd like to use jq to then parse this; you could something like: aws ec2 describe-images --image-ids ami-0def3275 --region us-west-2 | jq -r .Images[0].OwnerId More on stackoverflow.com
🌐 stackoverflow.com
How to know the version of the AMI used by a subscriber?
I need assistance with seller delivery data feed service. 1. When I add a version to my existing product in AWS Marketplace, is a new Product ID generated for the new version? 2. If I am using Da... More on repost.aws
🌐 repost.aws
1
0
November 25, 2024
AWS Marketplace AMI ARN for Terraform?
Once you subscribe to marketplace AMI /EC2 / service, you can get the AMI ID from the subscriptions page. Just type license or subscription in the search. You can also find it browsing your AMIs buts it's hit and miss on if it shows up or is hidden away under some sub menu. Programmatically, you can so get this via Awscli. More on reddit.com
🌐 r/Terraform
3
0
May 2, 2022
How to find an AMI ID.
Go to Kali's official website: https://www.kali.org/ Click Download: https://www.kali.org/get-kali/ Click Cloud. Click Amazon AWS. On the marketplace page, click Continue to Subscribe (the subscription is $0/hr on top of EC2 pricing, so it's fine): https://aws.amazon.com/marketplace/pp/prodview-fznsw3f7mq7to Once you've subscribed, you'll get an AMI ID you can use in Packer. More on reddit.com
🌐 r/aws
8
3
March 1, 2022
🌐
AWS
docs.aws.amazon.com › aws marketplace › buyer guide › product types available in aws marketplace › ami-based products in aws marketplace › using ami aliases in aws marketplace
Using AMI aliases in AWS Marketplace - AWS Marketplace
When you launch a product from AWS Marketplace, the AMI ID is automatically filled in for you. Having the AMI ID is useful if you want to automate launching products from the AWS Command Line Interface (AWS CLI) or by using Amazon Elastic Compute Cloud (Amazon EC2). You can find the AMI ID ...
🌐
Leah Erb
leaherb.com › home › how to find an aws marketplace ami image id
How to Find an AWS Marketplace AMI Image ID - Leah Erb
February 22, 2020 - If you already created an instance using the Marketplace AMI, you can find the AMI ID in the Description of your EC2 instance. Otherwise, use the AWS Management Console to find the AMI:
🌐
Hosty
hosty.uk › aws › finding-an-ami-id-using-aws-cli-in-aws-marketplace
Finding an AMI ID Using AWS CLI in AWS Marketplace | hosty
After locating an AMI that meets your needs, write down its ID (ami-xxxxxxxx). You can use this AMI to launch instances. For more information, see Launching an Instance Using the AWS CLI in the AWS Command Line Interface User Guide.
🌐
Amazon Web Services
docs.aws.amazon.com › amazon ec2 › user guide › amazon machine images in amazon ec2 › paid amis in the aws marketplace for amazon ec2 instances › find a paid ami
Find a paid AMI - Amazon Elastic Compute Cloud
April 17, 2026 - In the navigation pane, choose AMIs. Choose Public images for the first filter. ... If you know the product code, choose Product code, then =, and then enter the product code. If you do not know the product code, in the Search bar, specify the following filter: Owner alias=aws-marketplace. Specify additional filters as needed. Save the ID ...
Find elsewhere
🌐
AWS
docs.aws.amazon.com › aws marketplace › seller guide › ami-based products in aws marketplace › understanding ami-based products in aws marketplace
Understanding AMI-based products in AWS Marketplace - AWS Marketplace
The product ID is used to identify your product in the AWS Marketplace catalog, in customer billing, and in seller reports. The product code is attached to instances created from your AMI as instance metadata. When an AMI with that product code is used to create an instance, the customer will get a bill that shows the associated product ID. After you create your product, find ...
🌐
Micro Focus
microfocus.com › documentation › arcsight › arcsight-platform-21.1 › as_platform_admin_guide › Content › deployment_cloud › AMI_ID_determine.htm
Determining the AMI ID - Micro Focus
Determine the AMI (Amazon Machine Image) ID used for your bastion instance. You can select an OS image and its corresponding AMI from the AWS Marketplace. Alternatively, you can find AMIs using the Amazon EC2 console. You can select from the list of AMIs when you use the launch wizard to launch ...
🌐
GitHub
github.com › 6mile › ami_finder
GitHub - 6mile/ami_finder: Find your ami_id's for all regions for your products in the AWS Marketplace · GitHub
Click on the button and it will take you to the subscription page for this product. The url will include the product id. Cut and paste it and use that with the ami_finder.sh script. Here's an example: https://aws.amazon.com/marketplace/server/procurement?productId=1459a17b-abde-428d-8b9f-dac876e6ab87
Author   6mile
🌐
Gruntwork
blog.gruntwork.io › locating-aws-ami-owner-id-and-image-name-for-packer-builds-7616fe46b49a
Gruntwork Blog | Locating AWS Marketplace AMI Owner Id and Image Name for Packer Builds
December 9, 2017 - To start, let’s head over to https://aws.amazon.com/marketplace and do a quick search for our base Ubuntu image: Once we’ve located the image we want, click on its heading to view the details page. Then, click on its Continue button. You will be redirected to the Launch on EC2 page. From this page, we actually just want to extract the productid for the AMI from the page’s URL. Now that we have the productid, we can use the aws cli to help us find ...
🌐
devDosvid blog
devdosvid.blog › posts › five practical ways to get the verified ec2 ami
Five Practical Ways To Get The Verified EC2 AMI | devDosvid blog
July 27, 2022 - AMIs shared by verified sources have amazon (for AWS) or aws-marketplace (for AWS partners) as the value for the Owner alias filter. Finding the official AMI with Terraform is also simple — the aws_ami data source does the job.
🌐
AWS
docs.aws.amazon.com › aws managed services › ams advanced concepts and procedures › finding the data you need (skms), ams › find ami ids, ams
Find AMI IDs, AMS - AMS Advanced User Guide
An Amazon Machine Image, or AMI, is a template for Amazon EC2 instances, created from an Amazon EC2 instance. AWS provides updated AMIs (with patches, for example) every month; however, AWS Managed Services (AMS) requires AMIs that have been modified for AMS use.
🌐
AWS re:Post
repost.aws › questions › QUgwgvP2TVRxi7BXpAmZk5dA › how-to-know-the-version-of-the-ami-used-by-a-subscriber
How to know the version of the AMI used by a subscriber? | AWS re:Post
November 25, 2024 - Can you be more specific about how to get version based tracking of my AMI product based on Seller Data Feeds? ... I've reviewed it and can confirm that the information provided is accurate and comprehensive. Here's a brief comment to reinforce the key points: The response accurately explains that the Product ID remains constant across all versions of a product in AWS Marketplace.
🌐
GitHub
gist.github.com › isimaka › d0855433952c65fbb5df37b01003ac0f
Find AMI Image ID, Owner ID in AWS Marketplace. In AWS marketplace, it is not easy to find the Owner_ID and Image_ID of an AMI. Here is a work around. · GitHub
Find AMI Image ID, Owner ID in AWS Marketplace. In AWS marketplace, it is not easy to find the Owner_ID and Image_ID of an AMI. Here is a work around. - find_imageID_ownerID.sh
🌐
Reddit
reddit.com › r/terraform › aws marketplace ami arn for terraform?
r/Terraform on Reddit: AWS Marketplace AMI ARN for Terraform?
May 2, 2022 -

Trying to use a marketplace AMI for the parent_image template since I can't find the ARN but for parent_image it says the ARN is required.. is there a way to sub something that just has an AMI?

parent_image = "arn:${data.aws_partition.current.partition}:imagebuilder:${data.aws_region.current.name}:aws:image/amazon-linux-2-x86/x.x.x"

🌐
Blogger
websitenotebook.blogspot.com › 2017 › 06 › find-all-ami-ids-from-specific-vendor.html
@TeriRadichel | Cloud. Security. Software.: Find all the AMI IDs from a specific vendor in the AWS Marketplace
June 4, 2017 - From here I can see that the owner ID for the AMI from WatchGuard is 679593333241. Now I can use that in my query to get all the AMIs from WatchGuard: aws ec2 describe-images --filters "Name=description,Values=firebox*" --owners 679593333241 · Oh but wait....The ImageOwnerAlias is "aws-marketplace".