crccheck / cloudwatch-to-graphite

Helper for pushing AWS CloudWatch metrics to Graphite
Apache License 2.0
55 stars 28 forks source link

plumbum connections hard-coded to 'us-east-1' #14

Closed rbradley closed 9 years ago

rbradley commented 9 years ago

Are there plans for plumbum to support other regions? How should one handle the hard-coded connection?

crccheck commented 9 years ago

oh, I just haven't gotten around to it yet. I imagined it would be with an option. I don't have any experience connecting to other regions yet. Is it typically specified in a config file someplace? environment variable? command line option?

rbradley commented 9 years ago

I've been thinking about the best way to handle it also. You could get the default region from boto.config the way boto does it, and/or add another option. See the boto.ec2.connection.EC2Connection. It gets it from the boto config ec2_region_name.

DefaultRegionName = boto.config.get('Boto', 'ec2_region_name', 'us-east-1')

Then add a command line parm? (shift them to the right one?) (Perhaps also error check against the valid regions.)

region = options[2].lower()
region = region or DefaultRegionName

Connecting to another region is just as simple as 'us-east-1'.

conn = boto.rds.connect_to_region(region)

I can try and fork and come up with something today if you want. (I need something this weekend).

crccheck commented 9 years ago

cool cool. I'll get in front of a computer in about 7 hours and check this out.