AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ProcessProvider

import "github.com/aws/aws-sdk-go/aws/credentials/processcreds"

type ProcessProvider struct { credentials.Expiry Duration time.Duration ExpiryWindow time.Duration MaxBufSize int Timeout time.Duration }

ProcessProvider satisfies the credentials.Provider interface, and is a client to retrieve credentials from a process.

Expiry

Type: credentials.Expiry

Duration

Type: time.Duration

Expiry duration of the credentials. Defaults to 15 minutes if not set.

ExpiryWindow

Type: time.Duration

ExpiryWindow will allow the credentials to trigger refreshing prior to the credentials actually expiring. This is beneficial so race conditions with expiring credentials do not cause request to fail unexpectedly due to ExpiredTokenException exceptions.

So a ExpiryWindow of 10s would cause calls to IsExpired() to return true 10 seconds before the credentials are actually expired.

If ExpiryWindow is 0 or less it will be ignored.

MaxBufSize

Type: int

MaxBufSize limits memory usage from growing to an enormous amount due to a faulty process.

Timeout

Type: time.Duration

Timeout limits the time a process can run.

Method

IsExpired

func (p *ProcessProvider) IsExpired() bool

IsExpired returns true if the credentials retrieved are expired, or not yet retrieved.

Retrieve

func (p *ProcessProvider) Retrieve() (credentials.Value, error)

Retrieve executes the 'credential_process' and returns the credentials.

On this page: