Class DefaultSdkPresigner.Builder<B extends DefaultSdkPresigner.Builder<B>>

java.lang.Object
software.amazon.awssdk.services.s3.internal.signing.DefaultSdkPresigner.Builder<B>
All Implemented Interfaces:
SdkPresigner.Builder
Direct Known Subclasses:
DefaultS3Presigner.Builder
Enclosing class:
DefaultSdkPresigner

public abstract static class DefaultSdkPresigner.Builder<B extends DefaultSdkPresigner.Builder<B>> extends Object implements SdkPresigner.Builder
The base class implementing the SdkPresigner.Builder interface.
  • Method Details

    • region

      public B region(Region region)
      Description copied from interface: SdkPresigner.Builder
      Configure the region for which the requests should be signed.

      If this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:

      1. Check the 'aws.region' system property for the region.
      2. Check the 'AWS_REGION' environment variable for the region.
      3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.
      4. If running in EC2, check the EC2 metadata service for the region.

      If the region is not found in any of the locations above, an exception will be thrown at SdkPresigner.Builder.build() time.

      Specified by:
      region in interface SdkPresigner.Builder
    • credentialsProvider

      public B credentialsProvider(AwsCredentialsProvider credentialsProvider)
      Description copied from interface: SdkPresigner.Builder
      Configure the credentials that should be used for request signing.

      The default provider will attempt to identify the credentials automatically using the following checks:

      1. Java System Properties - aws.accessKeyId and aws.secretAccessKey
      2. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
      3. Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
      4. Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable is set and security manager has permission to access the variable.
      5. Instance profile credentials delivered through the Amazon EC2 metadata service

      If the credentials are not found in any of the locations above, an exception will be thrown at SdkPresigner.Builder.build() time.

      The last of SdkPresigner.Builder.credentialsProvider(AwsCredentialsProvider) or SdkPresigner.Builder.credentialsProvider(IdentityProvider) wins.

      Specified by:
      credentialsProvider in interface SdkPresigner.Builder
    • credentialsProvider

      public B credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider)
      Description copied from interface: SdkPresigner.Builder
      Configure the credentials that should be used to authenticate with AWS.

      The default provider will attempt to identify the credentials automatically using the following checks:

      1. Java System Properties - aws.accessKeyId and aws.secretAccessKey
      2. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
      3. Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
      4. Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable is set and security manager has permission to access the variable.
      5. Instance profile credentials delivered through the Amazon EC2 metadata service

      If the credentials are not found in any of the locations above, an exception will be thrown at SdkPresigner.Builder.build() time.

      The last of SdkPresigner.Builder.credentialsProvider(AwsCredentialsProvider) or SdkPresigner.Builder.credentialsProvider(IdentityProvider) wins.

      Specified by:
      credentialsProvider in interface SdkPresigner.Builder
    • dualstackEnabled

      public B dualstackEnabled(Boolean dualstackEnabled)
      Description copied from interface: SdkPresigner.Builder
      Configure whether the SDK should use the AWS dualstack endpoint.

      If this is not specified, the SDK will attempt to determine whether the dualstack endpoint should be used automatically using the following logic:

      1. Check the 'aws.useDualstackEndpoint' system property for 'true' or 'false'.
      2. Check the 'AWS_USE_DUALSTACK_ENDPOINT' environment variable for 'true' or 'false'.
      3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the 'use_dualstack_endpoint' property set to 'true' or 'false'.

      If the setting is not found in any of the locations above, 'false' will be used.

      Specified by:
      dualstackEnabled in interface SdkPresigner.Builder
    • fipsEnabled

      public B fipsEnabled(Boolean fipsEnabled)
      Description copied from interface: SdkPresigner.Builder
      Configure whether the SDK should use the AWS fips endpoint.

      If this is not specified, the SDK will attempt to determine whether the fips endpoint should be used automatically using the following logic:

      1. Check the 'aws.useFipsEndpoint' system property for 'true' or 'false'.
      2. Check the 'AWS_USE_FIPS_ENDPOINT' environment variable for 'true' or 'false'.
      3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the 'use_fips_endpoint' property set to 'true' or 'false'.

      If the setting is not found in any of the locations above, 'false' will be used.

      Specified by:
      fipsEnabled in interface SdkPresigner.Builder
    • endpointOverride

      public B endpointOverride(URI endpointOverride)
      Description copied from interface: SdkPresigner.Builder
      Configure an endpoint that should be used in the pre-signed requests. This will override the endpoint that is usually determined by the SdkPresigner.Builder.region(Region) and SdkPresigner.Builder.dualstackEnabled(Boolean) settings.
      Specified by:
      endpointOverride in interface SdkPresigner.Builder