Class: AwsAssumeRole::Credentials::Factories::Shared

Inherits:
AbstractFactory show all
Defined in:
lib/aws_assume_role/credentials/factories/shared.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 = {}) ⇒ Shared

Returns a new instance of Shared.


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

def initialize(options = {})
    logger.debug "Shared Factory initiated with #{options}"
    @profile = options[:profile]
    @credentials = AwsAssumeRole::Credentials::Providers::SharedKeyringCredentials.new(options)
    @region = @credentials.region
    @role_arn = @credentials.role_arn
rescue Aws::Errors::NoSuchProfileError
    nil
end