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

    • bucket

      @NonNull public final @NonNull String bucket

      bucket name of this backend.

      required.

    • root

      public final String root

      root of this backend.

      All operations will happen under this root.

      default to / if not set.

    • enableVersioning

      public final Boolean enableVersioning

      is bucket versioning enabled for this bucket

    • 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.
    • 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.
    • 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.
    • 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.
    • 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.

    • 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.

    • externalId

      public final String externalId

      external_id for this backend.

    • roleSessionName

      public final String roleSessionName

      role_session_name for this backend.

    • disableConfigLoad

      public final Boolean disableConfigLoad

      Disable config load so that opendal will not load config from environment.

      For examples:

      • envs like AWS_ACCESS_KEY_ID
      • files like ~/.aws/config
    • 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

    • allowAnonymous

      public final Boolean allowAnonymous

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

    • 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.
    • 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.

    • defaultStorageClass

      public final String defaultStorageClass

      default storage_class for this backend.

      Available values:

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

      S3 compatible services don't support all of them

    • 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
    • batchMaxOperations

      public final Long batchMaxOperations
      Deprecated.
      Please use `delete_max_size` instead of `batch_max_operations`

      Set maximum batch operations of this backend.

      Some compatible services have a limit on the number of operations in a batch request. For example, R2 could return Internal Error while batch delete 1000 files.

      Please tune this value based on services' document.

    • deleteMaxSize

      public final Long deleteMaxSize

      Set the maximum delete size of this backend.

      Some compatible services have a limit on the number of operations in a batch request. For example, R2 could return Internal Error while batch delete 1000 files.

      Please tune this value based on services' document.

    • disableStatWithOverride

      public final Boolean disableStatWithOverride

      Disable stat with override so that opendal will not send stat request with override queries.

      For example, R2 doesn't support stat with response_content_type query.

    • 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"
    • disableWriteWithIfMatch

      public final Boolean disableWriteWithIfMatch

      Disable write with if match so that opendal will not send write request with if match headers.

      For example, Ceph RADOS S3 doesn't support write with if match.

  • Constructor Details

    • S3

      public S3()
  • Method Details