Method: Fog::AWS::STS::Real#initialize

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

#initialize(options = {}) ⇒ Real

Initialize connection to STS

Notes

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

Examples

iam = STS.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

  • STS object with connection to AWS.

[View source]

67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/fog/aws/sts.rb', line 67

def initialize(options={})
  require 'fog/core/parser'

  @aws_access_key_id      = options[:aws_access_key_id]
  @aws_secret_access_key  = options[:aws_secret_access_key]
  @connection_options     = options[:connection_options] || {}
  @hmac       = Fog::HMAC.new('sha256', @aws_secret_access_key)
  @host       = options[:host]        || 'sts.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)
end