Table of Contents

Class EnvironmentVariablesAWSCredentials

Namespace
Amazon.Runtime
Assembly
AWSSDK.Core.dll

Uses aws credentials stored in environment variables to construct the credentials object. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are used for the access key id and secret key. If the variable AWS_SESSION_TOKEN exists then it will be used to create temporary session credentials.

public class EnvironmentVariablesAWSCredentials : AWSCredentials
Inheritance
EnvironmentVariablesAWSCredentials
Inherited Members

Remarks

For backwards compatibility the class will also attempt to discover the secret key from the AWS_SECRET_KEY variable, if a value cannot be obtained using the standard AWS_SECRET_ACCESS_KEY variable.

Constructors

EnvironmentVariablesAWSCredentials()

Constructs an instance of EnvironmentVariablesAWSCredentials. If no credentials are found in the environment variables then an InvalidOperationException is thrown.

public EnvironmentVariablesAWSCredentials()

Fields

ENVIRONMENT_VARIABLE_ACCESSKEY

public const string ENVIRONMENT_VARIABLE_ACCESSKEY = "AWS_ACCESS_KEY_ID"

Field Value

string

ENVIRONMENT_VARIABLE_SECRETKEY

public const string ENVIRONMENT_VARIABLE_SECRETKEY = "AWS_SECRET_ACCESS_KEY"

Field Value

string

ENVIRONMENT_VARIABLE_SESSION_TOKEN

public const string ENVIRONMENT_VARIABLE_SESSION_TOKEN = "AWS_SESSION_TOKEN"

Field Value

string

LEGACY_ENVIRONMENT_VARIABLE_SECRETKEY

public const string LEGACY_ENVIRONMENT_VARIABLE_SECRETKEY = "AWS_SECRET_KEY"

Field Value

string

Methods

FetchCredentials()

Creates immutable credentials from environment variables.

public ImmutableCredentials FetchCredentials()

Returns

ImmutableCredentials

GetCredentials()

Returns an instance of ImmutableCredentials for this instance

public override ImmutableCredentials GetCredentials()

Returns

ImmutableCredentials