You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::Sigv2::Credentials

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sigv2/lib/aws-sigv2/credentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Credentials

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


8
9
10
11
12
13
14
15
16
17
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 8

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

Instance Attribute Details

#access_key_idString (readonly)

Returns:

  • (String)


20
21
22
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 20

def access_key_id
  @access_key_id
end

#secret_access_keyString (readonly)

Returns:

  • (String)


23
24
25
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 23

def secret_access_key
  @secret_access_key
end

#session_tokenString? (readonly)

Returns:

  • (String, nil)


26
27
28
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 26

def session_token
  @session_token
end