Method: Fog::AWS::IAM::Real#initialize
- Defined in:
- lib/fog/aws/iam.rb
permalink #initialize(options = {}) ⇒ Real
Initialize connection to IAM
Notes
options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection
Examples
iam = IAM.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 {}.
Returns
-
IAM object with connection to AWS.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/fog/aws/iam.rb', line 149 def initialize(={}) require 'fog/core/parser' @aws_access_key_id = [:aws_access_key_id] @aws_secret_access_key = [:aws_secret_access_key] @connection_options = [:connection_options] || {} @instrumentor = [:instrumentor] @instrumentor_name = [:instrumentor_name] || 'fog.aws.iam' @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key) @host = [:host] || 'iam.amazonaws.com' @path = [:path] || '/' @persistent = [:persistent] || false @port = [:port] || 443 @scheme = [:scheme] || 'https' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) end |