1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|rds] add region and owner_id as RDS connection attributes

This commit is contained in:
Benton Roberts 2012-10-28 22:17:01 -04:00
parent e67eba360c
commit 41a277a9bd

View file

@ -118,6 +118,8 @@ module Fog
end
class Real
attr_reader :region
include Fog::AWS::CredentialFetcher::ConnectionMethods
# Initialize connection to ELB
#
@ -142,8 +144,8 @@ module Fog
setup_credentials(options)
@connection_options = options[:connection_options] || {}
options[:region] ||= 'us-east-1'
@host = options[:host] || "rds.#{options[:region]}.amazonaws.com"
@region = options[:region] || 'us-east-1'
@host = options[:host] || "rds.#{@region}.amazonaws.com"
@path = options[:path] || '/'
@persistent = options[:persistent] || false
@port = options[:port] || 443
@ -151,6 +153,10 @@ module Fog
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end
def owner_id
@owner_id ||= Fog::AWS[:rds].security_groups.get('default').owner_id
end
def reload
@connection.reset
end