How do I query in SM Parameter Store AMI Alias for a specific version of Amazon ECS-Optimized Amazon Linux 2 AMI

0

I am trying to query the AMI by lookup up the AMI Alias in SM Parameter Store for a specific version of Amazon ECS-Optimized Amazon Linux 2 AMI. The AMI Alias listed on Marketplace (https://aws.amazon.com/marketplace/server/configuration?productId=9c5eb799-bb6a-4a52-8fda-8e90b3f751f1) is Ami Alias: /aws/service/marketplace/prod-phaazl5qm6pka/2.0.20220121

When I query Name: equals: /aws/service/marketplace/prod-phaazl5qm6pka/2.0.20220121 I get "You do not have any parameters in this region."

I am able to query the "latest" version of the AMI Alias with a query Name: equals: /aws/service/marketplace/prod-phaazl5qm6pka/latest and get back exactly on result that has a string value with the expected AMI (currently ami-0e4efed85dffc2b28 for us-east-2).

I want to create some automation that uses the AMI Alias for specific version, and not "latest" and be able to lookup the AMI by region. What am I doing wrong in my query? Or am I maybe missing some permissions or something somewhere?

1 個回答
0

According to the docs, the /latest is the only public AMI parameters. You can always use the CLI:

aws ec2 describe-images --filters 'Name=name,Values=amzn2-ami-ecs-hvm-2.0.20220121-x86_64-ebs' Name=owner-alias,Values=amazon --query Images[*].ImageId --output text --region us-east-2
profile pictureAWS
專家
kentrad
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南