How do I retrieve platform (windows, Linux/Unix) value for an instance/AMI? AWS Console shows the platform value for an AMI.
I have dumped the dict property on the AMI object but it does not show the correct platform?
Join Stack Overflow to learn, share knowledge, and build your career.
How do I retrieve platform (windows, Linux/Unix) value for an instance/AMI? AWS Console shows the platform value for an AMI.
I have dumped the dict property on the AMI object but it does not show the correct platform?
There is an attribute of the Image
object called platform
. This attribute will have a value of windows
if the image is a Windows image or None
if it is Linux. For example:
import boto.ec2
c = boto.ec2.connect_to_region('us-east-1')
images = c.get_all_images(owners='self')
for image in images:
if image.platform == 'windows':
print('Image {} is a Windows Image'.format(image.id))
else:
print('Image {} is a Linux Image'.format(image.id))