Method: Fog::AWS::EMR::Real#initialize

Defined in:
lib/fog/aws/emr.rb

#initialize(options = {}) ⇒ Real

Initialize connection to EMR

Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

Examples

emr = EMR.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. For instance, in ‘eu-west-1’, ‘us-east-1’ and etc.

Returns

  • EMR object with connection to AWS.

[View source]

65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/fog/aws/emr.rb', line 65

def initialize(options={})
  @use_iam_profile = options[:use_iam_profile]
  setup_credentials(options)
  @connection_options     = options[:connection_options] || {}

  options[:region] ||= 'us-east-1'
  @host = options[:host] || "elasticmapreduce.#{options[:region]}.amazonaws.com"
  @path       = options[:path]        || '/'
  @persistent = options[:persistent]  || false
  @port       = options[:port]        || 443
  @scheme     = options[:scheme]      || 'https'
  @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
  @region = options[:region]
end