AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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

Module: Aws::CredentialProvider

Included in:
AssumeRoleCredentials, ECSCredentials, InstanceProfileCredentials, SharedCredentials
Defined in:
aws-sdk-core/lib/aws-sdk-core/credential_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#credentialsCredentials (readonly)

Returns:



7
8
9
# File 'aws-sdk-core/lib/aws-sdk-core/credential_provider.rb', line 7

def credentials
  @credentials
end

Instance Method Details

#access_key_idObject

Deprecated.

Deprecated in 2.1.0. This method is subject to errors from a race condition when called against refreshable credential objects. Will be removed in 2.2.0.

See Also:



18
19
20
# File 'aws-sdk-core/lib/aws-sdk-core/credential_provider.rb', line 18

def access_key_id
  credentials ? credentials.access_key_id : nil
end

#secret_access_keyObject

Deprecated.

Deprecated in 2.1.0. This method is subject to errors from a race condition when called against refreshable credential objects. Will be removed in 2.2.0.

See Also:



27
28
29
# File 'aws-sdk-core/lib/aws-sdk-core/credential_provider.rb', line 27

def secret_access_key
  credentials ? credentials.secret_access_key : nil
end

#session_tokenObject

Deprecated.

Deprecated in 2.1.0. This method is subject to errors from a race condition when called against refreshable credential objects. Will be removed in 2.2.0.

See Also:



36
37
38
# File 'aws-sdk-core/lib/aws-sdk-core/credential_provider.rb', line 36

def session_token
  credentials ? credentials.session_token : nil
end

#set?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'aws-sdk-core/lib/aws-sdk-core/credential_provider.rb', line 10

def set?
  !!credentials && credentials.set?
end