1

How do I find all Ubuntu images available in my region?

Attempt:

from boto.ec2 import connect_to_region


conn = connect_to_region(**dict(region_name=region, **aws_keys))
if not filters:  # Not as default arguments, as they should be immutable
    filters = {
        'architecture': 'x86_64',
        'name': 'ubuntu/images/ebs-*'
    }
print conn.get_all_images(owners=['amazon'], filters=filters)

I've also tried setting ubuntu/images/ebs-ssd/ubuntu-trusty-14.04-amd64-server-20140927, ubuntu*, *ubuntu and *ubuntu*.

A T
  • 13,008
  • 21
  • 97
  • 158

1 Answers1

1

The AWS API does not accept globs in search filters as far as I am aware. You can use the owner id to find it. 'Amazon' is not the owner of the ubuntu images Canonical is.

Change owners=['amazon'] to owners=['099720109477'].

There is no owner alias for canonical as far as I can see, so you will have to use the owner id instead.

Hope this helps.

ptierno
  • 9,534
  • 2
  • 23
  • 35
  • Thanks. And it does support globs, just tried: `'name': 'ubuntu*ssd*14.04*20140724'` which returned `[u'ubuntu/images/ebs-ssd/ubuntu-trusty-14.04-amd64-server-20140724', u'ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20140724']` – A T Nov 03 '14 at 09:38