Class StaticCredentialsProvider.StaticCredentialsProviderBuilder

  • Enclosing class:
    StaticCredentialsProvider

    public static class StaticCredentialsProvider.StaticCredentialsProviderBuilder
    extends java.lang.Object
    A simple builder class for a static credentials provider and its options
    • Constructor Detail

      • StaticCredentialsProviderBuilder

        public StaticCredentialsProviderBuilder()
        Default constructor
    • Method Detail

      • withSecretAccessKey

        public StaticCredentialsProvider.StaticCredentialsProviderBuilder withSecretAccessKey​(byte[] secretAccessKey)
        Sets the AWS secret access key to use within the static credentials
        Parameters:
        secretAccessKey - AWS secret access key to use
        Returns:
        this builder object
      • withSessionToken

        public StaticCredentialsProvider.StaticCredentialsProviderBuilder withSessionToken​(byte[] sessionToken)
        Sets the AWS session token to use within the static credentials. Session credentials are inherently time-bound; static providers do not provide any mechanism to update session-based credentials, and use of session-based credentials with a static provider is discouraged.
        Parameters:
        sessionToken - AWS session token to use
        Returns:
        this builder object
      • build

        public StaticCredentialsProvider build()
        Builds a new static credentials provider based on the builder configuration
        Returns:
        a new static credentials provider