Method: Aws::Sigv4::Credentials#initialize

Defined in:
lib/aws-sigv4/credentials.rb

#initialize(options = {}) ⇒ Credentials

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Credentials.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :access_key_id (required, String)
  • :secret_access_key (required, String)
  • :session_token (String, nil) — default: nil


13
14
15
16
17
18
19
20
21
22
# File 'lib/aws-sigv4/credentials.rb', line 13

def initialize(options = {})
  if options[:access_key_id] && options[:secret_access_key]
    @access_key_id = options[:access_key_id]
    @secret_access_key = options[:secret_access_key]
    @session_token = options[:session_token]
  else
    msg = "expected both :access_key_id and :secret_access_key options"
    raise ArgumentError, msg
  end
end