Class: Swa::IAM::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/swa/iam/credentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Credentials

Returns a new instance of Credentials.



6
7
8
9
10
# File 'lib/swa/iam/credentials.rb', line 6

def initialize(attributes = {})
  attributes.to_h.each do |k,v|
    send("#{k}=", v)
  end
end

Instance Attribute Details

#access_key_idObject

Returns the value of attribute access_key_id.



12
13
14
# File 'lib/swa/iam/credentials.rb', line 12

def access_key_id
  @access_key_id
end

#expires_atObject

Returns the value of attribute expires_at.



16
17
18
# File 'lib/swa/iam/credentials.rb', line 16

def expires_at
  @expires_at
end

#secret_access_keyObject

Returns the value of attribute secret_access_key.



13
14
15
# File 'lib/swa/iam/credentials.rb', line 13

def secret_access_key
  @secret_access_key
end

#session_tokenObject

Returns the value of attribute session_token.



14
15
16
# File 'lib/swa/iam/credentials.rb', line 14

def session_token
  @session_token
end

Instance Method Details

#to_envObject



19
20
21
22
23
24
25
26
# File 'lib/swa/iam/credentials.rb', line 19

def to_env
  {
    "AWS_ACCESS_KEY_ID" => access_key_id,
    "AWS_SECRET_ACCESS_KEY" => secret_access_key,
    "AWS_SESSION_TOKEN" => session_token,
    "AWS_SESSION_EXPIRES" => expires_at.iso8601
  }
end