You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

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

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: https://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 CredentialProvider

#access_key_id, #secret_access_key, #session_token, #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



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

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

  super
end