Class: Aws::InstanceProfileCredentials::Token Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Token used to fetch IMDS profile and credentials

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, ttl, created_time = Time.now) ⇒ Token

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Token.

API:

  • private



341
342
343
344
345
# File 'lib/aws-sdk-core/instance_profile_credentials.rb', line 341

def initialize(value, ttl, created_time = Time.now)
  @ttl = ttl
  @value = value
  @created_time = created_time
end

Instance Attribute Details

#valueObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

String

token value

API:

  • private



348
349
350
# File 'lib/aws-sdk-core/instance_profile_credentials.rb', line 348

def value
  @value
end

Instance Method Details

#expired?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

API:

  • private



350
351
352
# File 'lib/aws-sdk-core/instance_profile_credentials.rb', line 350

def expired?
  Time.now - @created_time > @ttl
end