Class: Aws::ProcessCredentials

Inherits:
Object
  • Object
show all
Includes:
CredentialProvider
Defined in:
gems/aws-sdk-core/lib/aws-sdk-core/process_credentials.rb

Overview

A credential provider that executes a given process and attempts to read its stdout to recieve a JSON payload containing the credentials.

credentials = Aws::ProcessCredentials.new('/usr/bin/credential_proc')
ec2 = Aws::EC2::Client.new(credentials: credentials)

Automatically handles refreshing credentials if an Expiration time is provided in the credentials payload.

Instance Attribute Summary

Attributes included from CredentialProvider

#credentials

Instance Method Summary collapse

Methods included from CredentialProvider

#set?

Constructor Details

#initialize(process) ⇒ ProcessCredentials

Creates a new ProcessCredentials object, which allows an external process to be used as a credential provider.

credentials provider.

Parameters:

  • process (String)

    Invocation string for process



24
25
26
27
28
29
30
# File 'gems/aws-sdk-core/lib/aws-sdk-core/process_credentials.rb', line 24

def initialize(process)
  @process = process
  @credentials = credentials_from_process(@process)
  @async_refresh = false

  super
end