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

Class: Aws::InstanceProfileCredentials

Inherits:
Object
  • Object
show all
Includes:
CredentialProvider
Defined in:
gems/aws-sdk-core/lib/aws-sdk-core/instance_profile_credentials.rb

Instance Attribute Summary collapse

Attributes included from CredentialProvider

#credentials

Instance Method Summary collapse

Methods included from CredentialProvider

#access_key_id, #secret_access_key, #session_token, #set?

Constructor Details

#initialize(options = {}) ⇒ InstanceProfileCredentials

Returns a new instance of InstanceProfileCredentials

Parameters:

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

Options Hash (options):

  • :retries (Integer) — default: 5

    Number of times to retry when retrieving credentials.

  • :ip_address (String) — default: '169.254.169.254'
  • :port (Integer) — default: 80
  • :http_open_timeout (Float) — default: 5
  • :http_read_timeout (Float) — default: 5
  • :delay (Numeric, Proc)

    By default, failures are retried with exponential back-off, i.e. sleep(1.2 ** num_failures). You can pass a number of seconds to sleep between failed attempts, or a Proc that accepts the number of failures.

  • :http_debug_output (IO) — default: nil

    HTTP wire traces are sent to this object. You can specify something like $stdout.



43
44
45
46
47
48
49
50
51
52
# File 'gems/aws-sdk-core/lib/aws-sdk-core/instance_profile_credentials.rb', line 43

def initialize options = {}
  @retries = options[:retries] || 5
  @ip_address = options[:ip_address] || '169.254.169.254'
  @port = options[:port] || 80
  @http_open_timeout = options[:http_open_timeout] || 5
  @http_read_timeout = options[:http_read_timeout] || 5
  @http_debug_output = options[:http_debug_output]
  @backoff = backoff(options[:backoff])
  super
end

Instance Attribute Details

#retriesInteger (readonly)

Returns The number of times to retry failed atttempts to fetch credentials from the instance metadata service. Defaults to 0.

Returns:

  • (Integer)

    The number of times to retry failed atttempts to fetch credentials from the instance metadata service. Defaults to 0.



56
57
58
# File 'gems/aws-sdk-core/lib/aws-sdk-core/instance_profile_credentials.rb', line 56

def retries
  @retries
end