Skip to content Skip to sidebar Skip to footer

Difficulty In Finding The Region Names In Aws Rds

How to get the names of all the rds instances in AWS using a boto script. I want to write a python script that fetches all the regions and then displays their dbinstances.

Solution 1:

The following should give you all of the available regions for RDS.

import boto.rdsregions= boto.rds.regions()

Which would return a list of RegionInfo objects like this.

[RegionInfo:us-east-1,
 RegionInfo:cn-north-1,
 RegionInfo:ap-northeast-1,
 RegionInfo:eu-west-1,
 RegionInfo:ap-southeast-1,
 RegionInfo:ap-southeast-2,
 RegionInfo:us-west-2,
 RegionInfo:us-gov-west-1,
 RegionInfo:us-west-1,
 RegionInfo:eu-central-1,
 RegionInfo:sa-east-1]

If you then wanted to connect to one particular region, say eu-west-1 you could do this:

region = regions[6]
conn = region.connect()

or even:

conn = boto.rds.connect_to_region(region.name)

Post a Comment for "Difficulty In Finding The Region Names In Aws Rds"