Class: Aws::ProcessCredentials

Inherits:
Object
  • Object
show all
Includes:
CredentialProvider, RefreshingCredentials
Defined in:
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

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

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

ec2 = Aws::EC2::Client.new(credentials: credentials)

More documentation on process based credentials can be found here: docs.aws.amazon.com/cli/latest/topic/config-vars.html#sourcing-credentials-from-external-processes

Instance Attribute Summary

Attributes included from CredentialProvider

#credentials

Instance Method Summary collapse

Methods included from RefreshingCredentials

#credentials, #expiration, #refresh!

Methods included from CredentialProvider

#access_key_id, #secret_access_key, #session_token, #set?

Methods included from Deprecations

#deprecated

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



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

def initialize(process)
  @process = process
  @credentials = credentials_from_process(@process)
end