Reputation: 844
I'm not able to find any aws api which will give OS name for a particular ec2 AMI. Can any one help to identify any api for this? I was trying this below api in python and checked with aws-cli also.
session = boto3.session.Session(
aws_access_key_id="",
aws_secret_access_key="",
)
ec2_client = session.client('ec2', 'us-east-1')
images=ec2_client.describe_images(
ImageIds=[
'ami-011b3ccf1bd6db744',
]
)
This doesn't give me proper information about OS. I can see only for windows images "Platform": "windows"
comes. How can I get the OS related information?
Upvotes: 0
Views: 281
Reputation: 16302
There's no field that stores distribution name per se. You'll have to use a combination of image description and owner to determine the ami to run.
Amis disappear as they age as well, so creating your own ami copies or a dynamic lookup process is best.
Upvotes: 1