Class StaticCredentialsProvider

java.lang.Object
software.amazon.awssdk.auth.credentials.StaticCredentialsProvider
All Implemented Interfaces:
AwsCredentialsProvider, IdentityProvider<AwsCredentialsIdentity>

public final class StaticCredentialsProvider extends Object implements AwsCredentialsProvider
An implementation of AwsCredentialsProvider that returns a set implementation of AwsCredentials.
  • Method Details

    • create

      public static StaticCredentialsProvider create(AwsCredentials credentials)
      Create a credentials provider that always returns the provided set of credentials.
    • resolveCredentials

      public AwsCredentials resolveCredentials()
      Description copied from interface: AwsCredentialsProvider
      Returns AwsCredentials that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider can choose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated.

      If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.

      Specified by:
      resolveCredentials in interface AwsCredentialsProvider
      Returns:
      AwsCredentials which the caller can use to authorize an AWS request.
    • toString

      public String toString()
      Overrides:
      toString in class Object