Class ProcessCredentialsBuilder

java.lang.Object
com.adaptris.aws2.ProcessCredentialsBuilder
All Implemented Interfaces:
AWSCredentialsProviderBuilder

@ComponentProfile(summary="Credentials provider that can load credentials from an external process", since="4.3.0") public class ProcessCredentialsBuilder extends Object implements AWSCredentialsProviderBuilder
Credentials provider that can load credentials from an external process.

See https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#sourcing-credentials-from-external-processes for more information

Since:
4.3.0

In the adapter configuration file this class is aliased as aws2-process-credentials-builder which is the preferred alternative to the fully qualified classname when building your configuration.

  • Constructor Details

    • ProcessCredentialsBuilder

      public ProcessCredentialsBuilder()
  • Method Details

    • build

      public software.amazon.awssdk.auth.credentials.AwsCredentialsProvider build() throws Exception
      Specified by:
      build in interface AWSCredentialsProviderBuilder
      Throws:
      Exception
    • withCommand

      public ProcessCredentialsBuilder withCommand(String s)
    • withProcessOutputLimitBytes

      public ProcessCredentialsBuilder withProcessOutputLimitBytes(Long l)
    • withExpirationBufferSeconds

      public ProcessCredentialsBuilder withExpirationBufferSeconds(Integer i)
    • getCommand

      @NonNull public @NonNull String getCommand()
      The command that should be executed to retrieve credentials including arguments

      e.g. if you have a custom aws2 credentials program that takes arguments then you could have /opt/bin/awscreds-custom --username interlok here. The program is expected to output JSON data as per the documentation

    • setCommand

      public void setCommand(@NonNull @NonNull String command)
      The command that should be executed to retrieve credentials including arguments

      e.g. if you have a custom aws2 credentials program that takes arguments then you could have /opt/bin/awscreds-custom --username interlok here. The program is expected to output JSON data as per the documentation

    • getProcessOutputLimitBytes

      public Long getProcessOutputLimitBytes()
      The maximum amount of data that can be returned by the external process before an exception is raised.

      If not specified, then the AWS internal default is used (currently 1024 bytes).

    • setProcessOutputLimitBytes

      public void setProcessOutputLimitBytes(Long processOutputLimitBytes)
      The maximum amount of data that can be returned by the external process before an exception is raised.

      If not specified, then the AWS internal default is used (currently 1024 bytes).

    • getExpirationBufferSeconds

      public Integer getExpirationBufferSeconds()
      The number of seconds between when the credentials expire and when the credentials should start to be refreshed.

      This setting allows the credentials to be refreshed before they are reported to expire. If not configured, then the AWS internal default is used (currently 15 seconds)

    • setExpirationBufferSeconds

      public void setExpirationBufferSeconds(Integer expirationBufferSeconds)
      The number of seconds between when the credentials expire and when the credentials should start to be refreshed.

      This setting allows the credentials to be refreshed before they are reported to expire. If not configured, then the AWS internal default is used (currently 15 seconds)