Issue
What I have is AMI id (something like this ami-06358f49b5839867c) The case was AMI i see in this href="https://github.com/logicalclocks/karamel-chef/blob/master/cluster-defns/aws.1.hopsworks.yml" rel="nofollow noreferrer">Karamel script
How do I find information about that AMI like Name, Region, ...?
Solution
Using describe-images, assuming the AMI is in the default region:
aws ec2 describe-images --image-ids ami-06358f49b5839867c
Otherwise you can specify the region, e.g.:
aws ec2 describe-images --image-ids ami-06358f49b5839867c --region eu-west-1
If you don't know the region where the AMI lives, then you'll have to use a loop to iterate over all AWS regions. In bash, this could look like:
for region in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text | tr '\t' '\n')
do
aws ec2 describe-images --image-ids ami-06358f49b5839867c --region "$region" &>/dev/null;
if [[ "$?" -eq 0 ]];
then echo "AMI found in region ${region}!" && break
fi
done
Answered By - Paolo Answer Checked By - Marilyn (WPSolving Volunteer)