Class ServiceConfig.S3

java.lang.Object
org.apache.opendal.ServiceConfig.S3
All Implemented Interfaces:
ServiceConfig
Enclosing interface:
ServiceConfig

public static class ServiceConfig.S3 extends Object implements ServiceConfig
Configuration for service s3.
  • Field Details

    • accessKeyId

      public final String accessKeyId

      access_key_id of this backend.

      • If access_key_id is set, we will take user's input first.
      • If not, we will try to load it from environment.
    • allowAnonymous

      public final Boolean allowAnonymous
      Deprecated.
      Please use `skip_signature` instead of `allow_anonymous`

      Allow anonymous will allow opendal to send request without signing when credential is not loaded.

    • assumeRoleDurationSeconds

      public final Integer assumeRoleDurationSeconds

      assume_role_duration_seconds for this backend.

    • assumeRoleSessionTags

      public final Map<String,String> assumeRoleSessionTags

      assume_role_session_tags for this backend.

    • batchMaxOperations

      public final Long batchMaxOperations
      Deprecated.
      S3 delete batch capability is enabled by default. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

      Deprecated: S3 delete batch capability is enabled by default.

    • bucket

      @NonNull public final @NonNull String bucket

      bucket name of this backend.

      required.

    • checksumAlgorithm

      public final String checksumAlgorithm

      Checksum Algorithm to use when sending checksums in HTTP headers. This is necessary when writing to AWS S3 Buckets with Object Lock enabled for example.

      Available options:

      • "crc32c"
      • "md5"
    • containerAuthorizationToken

      public final String containerAuthorizationToken

      Authorization token sent to the AWS container credential endpoint.

      This token takes precedence over the configured token file and the ambient direct and file token forms.

    • containerAuthorizationTokenFile

      public final String containerAuthorizationTokenFile

      File containing the authorization token sent to the AWS container credential endpoint.

      This file takes precedence over both ambient token forms. The credential provider trims surrounding whitespace after reading the file.

    • containerCredentialsEndpoint

      public final String containerCredentialsEndpoint

      Full URI for AWS container credential metadata.

      This endpoint takes precedence over the relative container credential URI and both ambient container credential URI forms. It does not change the position or priority of the default ECS credential provider.

    • containerCredentialsRelativeUri

      public final String containerCredentialsRelativeUri

      Relative URI for AWS container credential metadata.

      An explicit full endpoint takes precedence over this value. This value takes precedence over the ambient full and relative container credential URIs. OpenDAL joins it to container_metadata_uri_override when set, otherwise to http://169.254.170.2.

      Setting any container credential field replaces the ECS slot in the default credential chain. It does not move that slot ahead of earlier default providers.

    • containerMetadataUriOverride

      public final String containerMetadataUriOverride

      Base URI used to resolve a relative AWS container credential URI.

      This override affects relative URIs only. It does not alter a configured or ambient full URI. The override alone does not select an endpoint.

    • defaultAcl

      public final String defaultAcl

      Default ACL for new objects. Note that some s3 services like minio do not support this option.

    • defaultRegion

      public final String defaultRegion

      Fallback signing region when neither region, AWS_REGION, nor AWS_DEFAULT_REGION supplies one.

    • defaultStorageClass

      public final String defaultStorageClass

      default storage_class for this backend.

      Available values:

      • DEEP_ARCHIVE
      • GLACIER
      • GLACIER_IR
      • INTELLIGENT_TIERING
      • ONEZONE_IA
      • EXPRESS_ONEZONE
      • OUTPOSTS
      • REDUCED_REDUNDANCY
      • STANDARD
      • STANDARD_IA

      S3 compatible services don't support all of them

    • deleteMaxSize

      public final Long deleteMaxSize
      Deprecated.
      S3 delete batch capability is enabled by default. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

      Deprecated: S3 delete batch capability is enabled by default.

    • disableConfigLoad

      public final Boolean disableConfigLoad

      Disable automatic endpoint loading and the environment/profile credential providers.

      This skips endpoint environment variables and removes the static environment and shared-profile credential slots. Region environment lookup and other credential providers, including AWS container credentials and EC2 instance metadata, remain enabled.

    • disableEc2Metadata

      public final Boolean disableEc2Metadata

      Disable load credential from ec2 metadata.

      This option is used to disable the default behavior of opendal to load credential from ec2 metadata, a.k.a., IMDSv2

    • disableListObjectsV2

      public final Boolean disableListObjectsV2

      OpenDAL uses List Objects V2 by default to list objects. However, some legacy services do not yet support V2. This option allows users to switch back to the older List Objects V1.

    • disableStatWithOverride

      public final Boolean disableStatWithOverride
      Deprecated.
      S3 stat override capabilities are enabled by default. Use CapabilityOverrideLayer to override them for specific endpoints.

      Deprecated: S3 stat override capabilities are enabled by default.

    • disableWriteWithIfMatch

      public final Boolean disableWriteWithIfMatch
      Deprecated.
      S3 write with If-Match capability is enabled by default and this option is no longer needed.

      Deprecated: S3 write with If-Match capability is enabled by default.

    • enableRequestPayer

      public final Boolean enableRequestPayer

      Indicates whether the client agrees to pay for the requests made to the S3 bucket.

    • enableVersioning

      public final Boolean enableVersioning
      Deprecated.
      S3 versioning capability is enabled by default and this option is no longer needed.

      Deprecated: S3 versioning capability is enabled by default.

    • enableVirtualHostStyle

      public final Boolean enableVirtualHostStyle

      Enable virtual host style so that opendal will send API requests in virtual host style instead of path style.

      • By default, opendal will send API to https://s3.us-east-1.amazonaws.com/bucket_name
      • Enabled, opendal will send API to https://bucket_name.s3.us-east-1.amazonaws.com
    • enableWriteWithAppend

      public final Boolean enableWriteWithAppend
      Deprecated.
      S3 append capability is enabled by default and this option is no longer needed.

      Deprecated: S3 append capability is enabled by default.

    • endpoint

      public final String endpoint

      endpoint of this backend.

      Endpoint must be full uri, e.g.

      • AWS S3: https://s3.amazonaws.com or https://s3.{region}.amazonaws.com
      • Cloudflare R2: https://<ACCOUNT_ID>.r2.cloudflarestorage.com
      • Aliyun OSS: https://{region}.aliyuncs.com
      • Tencent COS: https://cos.{region}.myqcloud.com
      • Minio: http://127.0.0.1:9000

      If user inputs endpoint without scheme like "s3.amazonaws.com", we will prepend "https://" before it.

      • If endpoint is set, we will take user's input first.
      • If not, we will try to load it from environment.
      • If still not set, default to https://s3.amazonaws.com.
    • externalId

      public final String externalId

      external_id for this backend.

    • profile

      public final String profile

      AWS profile.

      By default, reqsign which is the default credential provider, supplies profile in order:

      • explicit option
      • AWS_PROFILE environment variable, from which reqsign reads profile from:
      • ~/.aws/credentials (or the path specified by AWS_SHARED_CREDENTIALS_FILE)
      • ~/.aws/config (or the path specified by AWS_CONFIG_FILE)
    • region

      public final String region

      Region represent the signing region of this endpoint. This is required if you are using the default AWS S3 endpoint.

      If using a custom endpoint,

      • If region is set, we will take user's input first.
      • If not, we will try to load it from environment.
    • roleArn

      public final String roleArn

      role_arn for this backend.

      If role_arn is set, we will use already known config as source credential to assume role with role_arn.

    • roleSessionName

      public final String roleSessionName

      role_session_name for this backend.

    • root

      public final String root

      root of this backend.

      All operations will happen under this root.

      default to / if not set.

    • secretAccessKey

      public final String secretAccessKey

      secret_access_key of this backend.

      • If secret_access_key is set, we will take user's input first.
      • If not, we will try to load it from environment.
    • serverSideEncryption

      public final String serverSideEncryption

      server_side_encryption for this backend.

      Available values: AES256, aws:kms.

    • serverSideEncryptionAwsKmsKeyId

      public final String serverSideEncryptionAwsKmsKeyId

      server_side_encryption_aws_kms_key_id for this backend

      • If server_side_encryption set to aws:kms, and server_side_encryption_aws_kms_key_id is not set, S3 will use aws managed kms key to encrypt data.
      • If server_side_encryption set to aws:kms, and server_side_encryption_aws_kms_key_id is a valid kms key id, S3 will use the provided kms key to encrypt data.
      • If the server_side_encryption_aws_kms_key_id is invalid or not found, an error will be returned.
      • If server_side_encryption is not aws:kms, setting server_side_encryption_aws_kms_key_id is a noop.
    • serverSideEncryptionBucketKeyEnabled

      public final Boolean serverSideEncryptionBucketKeyEnabled

      Control S3 Bucket Keys for SSE-KMS writes and copies.

      Omit this option to inherit the bucket setting. false disables Bucket Keys for destination objects, and true enables them.

    • serverSideEncryptionCustomerAlgorithm

      public final String serverSideEncryptionCustomerAlgorithm

      server_side_encryption_customer_algorithm for this backend.

      Available values: AES256.

    • serverSideEncryptionCustomerKey

      public final String serverSideEncryptionCustomerKey

      server_side_encryption_customer_key for this backend.

      Value: BASE64-encoded key that matches algorithm specified in server_side_encryption_customer_algorithm.

    • serverSideEncryptionCustomerKeyMd5

      public final String serverSideEncryptionCustomerKeyMd5

      Set server_side_encryption_customer_key_md5 for this backend.

      Value: MD5 digest of key specified in server_side_encryption_customer_key.

    • sessionToken

      public final String sessionToken

      session_token (aka, security token) of this backend.

      This token will expire after sometime, it's recommended to set session_token by hand.

    • skipSignature

      public final Boolean skipSignature

      Skip signature will skip loading credentials and signing requests.

  • Constructor Details

    • S3

      public S3()
  • Method Details