Method: Fog::AWS::RDS::Real#initialize
- Defined in:
- lib/fog/aws/rds.rb
#initialize(options = {}) ⇒ Real
Initialize connection to ELB
Notes
options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection
Examples
elb = ELB.new(
:aws_access_key_id => your_aws_access_key_id,
:aws_secret_access_key => your_aws_secret_access_key
)
Parameters
-
options<~Hash> - config arguments for connection. Defaults to {}.
-
region<~String> - optional region to use, in [‘eu-west-1’, ‘us-east-1’, ‘us-west-1’i, ‘ap-southeast-1’]
-
Returns
-
ELB object with connection to AWS.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/fog/aws/rds.rb', line 82 def initialize(={}) @aws_access_key_id = [:aws_access_key_id] @aws_secret_access_key = [:aws_secret_access_key] @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) [:region] ||= 'us-east-1' @host = [:host] || case [:region] when 'ap-northeast-1' 'rds.ap-northeast-1.amazonaws.com' when 'ap-southeast-1' 'rds.ap-southeast-1.amazonaws.com' when 'eu-west-1' 'rds.eu-west-1.amazonaws.com' when 'us-east-1' 'rds.us-east-1.amazonaws.com' when 'us-west-1' 'rds.us-west-1.amazonaws.com' else raise ArgumentError, "Unknown region: #{options[:region].inspect}" end @path = [:path] || '/' @port = [:port] || 443 @scheme = [:scheme] || 'https' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", [:persistent]) end |