Class: AwsAssumeRole::Credentials::Factories::InstanceProfile

Inherits:
AbstractFactory
  • Object
show all
Defined in:
lib/aws_assume_role/credentials/factories/instance_profile.rb

Constant Summary

Constants included from AwsAssumeRole::Credentials::Factories

Types

Constants included from AwsAssumeRole

AwsAssumeRole::Config, DefaultProvider, VERSION

Instance Attribute Summary

Attributes inherited from AbstractFactory

#credentials, #profile, #region, #role_arn

Instance Method Summary collapse

Methods inherited from AbstractFactory

priority, register_if_complete, type

Methods included from Logging

included

Methods included from AwsAssumeRole

shared_config

Constructor Details

#initialize(options = {}) ⇒ InstanceProfile

Returns a new instance of InstanceProfile.


7
8
9
10
11
12
13
14
15
16
# File 'lib/aws_assume_role/credentials/factories/instance_profile.rb', line 7

def initialize(options = {})
    options[:retries] ||= options[:instance_profile_credentials_retries] || 0
    options[:http_open_timeout] ||= options[:instance_profile_credentials_timeout] || 1
    options[:http_read_timeout] ||= options[:instance_profile_credentials_timeout] || 1
    @credentials = if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
                       Aws::ECSCredentials.new(options)
                   else
                       Aws::InstanceProfileCredentials.new(options)
                   end
end