Class: AWS::STS::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/sts/session.rb

Overview

Represents a session using temporary AWS credentials. Use #new_session or #new_federated_session to get a new set of temporary credentials.

Direct Known Subclasses

FederatedSession

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Session

Returns a new instance of Session.


41
42
43
44
# File 'lib/aws/sts/session.rb', line 41

def initialize(opts = {})
  @credentials = opts[:credentials]
  @expires_at = opts[:expires_at]
end

Instance Attribute Details

#credentialsHash (readonly)

A hash containing the following keys:

  • :access_key_id

  • :secret_access_key

  • :session_token

This hash may be passed as-is to AWS.config or to the constructor of any service interface that supports temporary security credentials from the AWS Security Token Service.

Returns:

  • (Hash)

33
34
35
# File 'lib/aws/sts/session.rb', line 33

def credentials
  @credentials
end

#expires_atTime (readonly)

The date on which these credentials expire.

Returns:

  • (Time)

38
39
40
# File 'lib/aws/sts/session.rb', line 38

def expires_at
  @expires_at
end