jeudi 15 octobre 2015

Boto rds.get_all_dbinstances returning empty list

I'm trying to obtain a list of all my AWS RDS instances using Python's Boto module. I can obtain the instance metadata fine which I then read into the connection to utilise get_all_dbinstances() but keep getting [] returned.

from boto.utils import get_instance_metadata
import boto.rds

# This works fine    
m =  get_instance_metadata()

access_key = m[****]
secret_key = m[****]
security_token = m[****]

try:
# And this works fine
    region_object = boto.rds.connect_to_region("eu-central-1", aws_access_key_id=access_key, aws_secret_access_key=secret_key)

except ValueError, e:
    print "Error: {0}".format(e.message)

rds = boto.connect_rds(aws_access_key_id = access_key, aws_secret_access_key = secret_key, security_token = security_token, region=region_object.region)
instances = rds.get_all_dbinstances()
print instances

>> []




Aucun commentaire:

Enregistrer un commentaire