Module: Eaglenube::AWSCredentialBuilder

Included in:
AWSAgent
Defined in:
lib/eaglenube/aws_credential_builder.rb

Instance Method Summary collapse

Instance Method Details

#build_credential(credential) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/eaglenube/aws_credential_builder.rb', line 6

def build_credential(credential)
  if credential[:session_token].blank?
    Aws::Credentials.new(credential[:access_key_id], credential[:secret_access_key])
  else
    Aws::Credentials.new(credential[:access_key_id], credential[:secret_access_key], credential[:session_token])
  end
end