AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Credentials that are retrieved using a stored profile.
Unless otherwise specified priority is given to loading credentials from the SDK credential store file which is shared between the SDK, PowerShell CLI and Toolkit. Credentials in profiles in this file are encrypted and can only be used by the user account on the current machine that stored the profile. Credentials can also be loaded from the plain-text ini-format credential file which is shared with other AWS SDKs. This file is expected to exist in a '.aws' folder in the user's home directory but alternate locations can be specified using either the AWSProfilesLocation setting in the application configuration file, or by using the AWS_SHARED_CREDENTIALS_FILE environment variable.
The profile name can be specified in the App.config using the AWSProfileName setting.
Namespace: Amazon.Runtime
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z
[Obsolete("This class is obsolete and will be removed in a future release. Please use Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile or SharedCredentialsFile.. Visit http://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html for further details.")]
public class StoredProfileAWSCredentials : AWSCredentials
The StoredProfileAWSCredentials type exposes the following members
Name | Description | |
---|---|---|
StoredProfileAWSCredentials() |
Constructs an instance for credentials stored in a profile. This constructor searches for credentials using the account name specified using the AWSProfileName setting, if set, in the application configuration file. If the configuration file setting is not set the SDK will attempt to locate a profile with the name 'default'. |
|
StoredProfileAWSCredentials(string) |
Constructs an instance for credentials stored in a profile with the specified name. The SDK will check the SDK credential store file first before looking for the shared ini-format credentials file unless the application configuration file contains a setting for the 'AWSProfilesLocation' indicating the search should be constrained to the shared credentials file at the specified location. |
|
StoredProfileAWSCredentials(string, string) |
Constructs an instance for credentials stored in a profile with the specified name. |
Name | Type | Description | |
---|---|---|---|
ProfileName | System.String |
Name of the profile being used. |
|
ProfilesLocation | System.String |
Location of the profiles, if used. |
|
WrappedCredentials | Amazon.Runtime.AWSCredentials |
Name | Description | |
---|---|---|
CanCreateFrom(string, string) |
Tests if an instance can be created from the persisted profile data. If profilesLocation is null/empty, the SDK store is searched for the profile data before probing for the profile in the shared the ini-format credential file. |
|
GetCredentials() |
Returns an instance of ImmutableCredentials for this instance |
|
GetCredentialsAsync() | Inherited from Amazon.Runtime.AWSCredentials. | |
IsProfileKnown(string, string) |
Tests if a profile has been registered in either the SDK store or the specified credential file. |
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5