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

Class: Aws::Sigv2::StaticCredentialsProvider

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

Overview

The default credential provider class.

StaticCredentialsProvider.new({
  access_key_id: 'akid',
  secret_access_key: 'secret',
})

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ StaticCredentialsProvider

Returns a new instance of StaticCredentialsProvider

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :credentials (Credentials)
  • :access_key_id (String)
  • :secret_access_key (String)
  • :session_token (String) — default: nil


43
44
45
46
47
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 43

def initialize(options = {})
  @credentials = options[:credentials] ?
    options[:credentials] :
    Credentials.new(options)
end

Instance Attribute Details

#credentialsCredentials (readonly)

Returns:



50
51
52
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 50

def credentials
  @credentials
end