AWS SDK Version 4 for .NET
API Reference

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.

A resolver that provides an Amazon.Runtime.AWSCredentials identity.

The default search order used is described in the developer guide, but it can be overwritten by setting the Amazon.AWSConfigs.AWSCredentialsGenerators property.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.Credentials.DefaultAWSCredentialsIdentityResolver

Namespace: Amazon.Runtime.Credentials
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
public class DefaultAWSCredentialsIdentityResolver
         IDisposable, IIdentityResolver, IIdentityResolver<AWSCredentials>

The DefaultAWSCredentialsIdentityResolver type exposes the following members

Constructors

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.7.2 or higher.

NameDescription
Public Method Dispose()
Public Method Static Method GetCredentials(IClientConfig)

Search the environment for configured AWS credentials. The search includes environment variables, "default" AWS credentials profiles and EC2 instance metadata.

Public Method Static Method GetCredentialsAsync(IClientConfig)

Search the environment for configured AWS credentials. The search includes environment variables, "default" AWS credentials profiles and EC2 instance metadata.

Public Method Static Method GetProfileName()
Public Method ResolveIdentity(IClientConfig)

Resolves the identity using a cancellation token with a default of 35 seconds. 35 seconds is calculated as the worst case scenario for DefaultInstanceProfileAWSCredentials and its retry mechanism during resolution. To pass in your own cancellation token call Amazon.Runtime.Credentials.DefaultAWSCredentialsIdentityResolver.ResolveIdentity(Amazon.Runtime.IClientConfig,System.Threading.CancellationToken).

Public Method ResolveIdentity(IClientConfig, CancellationToken)

Resolves the identity using the provided cancellationToken. Pass a token with a timeout to avoid blocking indefinitely if a network call during credential resolution hangs.

Public Method ResolveIdentityAsync(IClientConfig, CancellationToken)

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer