Class ServiceConfig.S3
- All Implemented Interfaces:
ServiceConfig
- Enclosing interface:
- ServiceConfig
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.opendal.ServiceConfig
ServiceConfig.AliyunDrive, ServiceConfig.Alluxio, ServiceConfig.Atomicserver, ServiceConfig.Azblob, ServiceConfig.Azdls, ServiceConfig.Azfile, ServiceConfig.B2, ServiceConfig.Cacache, ServiceConfig.Chainsafe, ServiceConfig.CloudflareKv, ServiceConfig.Compfs, ServiceConfig.Cos, ServiceConfig.D1, ServiceConfig.Dashmap, ServiceConfig.Dbfs, ServiceConfig.Dropbox, ServiceConfig.Etcd, ServiceConfig.Fs, ServiceConfig.Gcs, ServiceConfig.Gdrive, ServiceConfig.Ghac, ServiceConfig.Github, ServiceConfig.Gridfs, ServiceConfig.HdfsNative, ServiceConfig.Http, ServiceConfig.Huggingface, ServiceConfig.Icloud, ServiceConfig.Ipfs, ServiceConfig.Ipmfs, ServiceConfig.Koofr, ServiceConfig.Lakefs, ServiceConfig.Libsql, ServiceConfig.Memcached, ServiceConfig.Memory, ServiceConfig.MiniMoka, ServiceConfig.Moka, ServiceConfig.Mongodb, ServiceConfig.Monoiofs, ServiceConfig.Mysql, ServiceConfig.NebulaGraph, ServiceConfig.Obs, ServiceConfig.Onedrive, ServiceConfig.Oss, ServiceConfig.Pcloud, ServiceConfig.Persy, ServiceConfig.Postgresql, ServiceConfig.Redb, ServiceConfig.Redis, ServiceConfig.S3, ServiceConfig.Seafile, ServiceConfig.Sftp, ServiceConfig.Sled, ServiceConfig.Sqlite, ServiceConfig.Supabase, ServiceConfig.Surrealdb, ServiceConfig.Swift, ServiceConfig.Upyun, ServiceConfig.VercelArtifacts, ServiceConfig.VercelBlob, ServiceConfig.Webdav, ServiceConfig.Webhdfs, ServiceConfig.YandexDisk
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
access_key_id of this backend.final Boolean
Allow anonymous will allow opendal to send request without signing when credential is not loaded.final Long
Deprecated.Please use `delete_max_size` instead of `batch_max_operations`final @NonNull String
bucket name of this backend.final String
Checksum Algorithm to use when sending checksums in HTTP headers.final String
default storage_class for this backend.final Long
Set the maximum delete size of this backend.final Boolean
Disable config load so that opendal will not load config from environment.final Boolean
Disable load credential from ec2 metadata.final Boolean
Disable stat with override so that opendal will not send stat request with override queries.final Boolean
Disable write with if match so that opendal will not send write request with if match headers.final Boolean
is bucket versioning enabled for this bucketfinal Boolean
Enable virtual host style so that opendal will send API requests in virtual host style instead of path style.final String
endpoint of this backend.final String
external_id for this backend.final String
Region represent the signing region of this endpoint.final String
role_arn for this backend.final String
role_session_name for this backend.final String
root of this backend.final String
secret_access_key of this backend.final String
server_side_encryption for this backend.final String
server_side_encryption_aws_kms_key_id for this backendfinal String
server_side_encryption_customer_algorithm for this backend.final String
server_side_encryption_customer_key for this backend.final String
Set server_side_encryption_customer_key_md5 for this backend.final String
session_token (aka, security token) of this backend. -
Constructor Summary
-
Method Summary
-
Field Details
-
bucket
bucket name of this backend.
required.
-
root
root of this backend.
All operations will happen under this root.
default to
/
if not set. -
enableVersioning
is bucket versioning enabled for this bucket
-
endpoint
endpoint of this backend.
Endpoint must be full uri, e.g.
- AWS S3:
https://s3.amazonaws.com
orhttps://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
.
- AWS S3:
-
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
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
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
session_token (aka, security token) of this backend.
This token will expire after sometime, it's recommended to set session_token by hand.
-
roleArn
role_arn for this backend.
If
role_arn
is set, we will use already known config as source credential to assume role withrole_arn
. -
externalId
external_id for this backend.
-
roleSessionName
role_session_name for this backend.
-
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
- envs like
-
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
Allow anonymous will allow opendal to send request without signing when credential is not loaded.
-
serverSideEncryption
server_side_encryption for this backend.
Available values:
AES256
,aws:kms
. -
serverSideEncryptionAwsKmsKeyId
server_side_encryption_aws_kms_key_id for this backend
- If
server_side_encryption
set toaws:kms
, andserver_side_encryption_aws_kms_key_id
is not set, S3 will use aws managed kms key to encrypt data. - If
server_side_encryption
set toaws:kms
, andserver_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 notaws:kms
, settingserver_side_encryption_aws_kms_key_id
is a noop.
- If
-
serverSideEncryptionCustomerAlgorithm
server_side_encryption_customer_algorithm for this backend.
Available values:
AES256
. -
serverSideEncryptionCustomerKey
server_side_encryption_customer_key for this backend.
Value: BASE64-encoded key that matches algorithm specified in
server_side_encryption_customer_algorithm
. -
serverSideEncryptionCustomerKeyMd5
Set server_side_encryption_customer_key_md5 for this backend.
Value: MD5 digest of key specified in
server_side_encryption_customer_key
. -
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
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
- By default, opendal will send API to
-
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
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
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
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
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
-
scheme
Description copied from interface:ServiceConfig
The scheme of the service.- Specified by:
scheme
in interfaceServiceConfig
- Returns:
- the scheme
-
configMap
Description copied from interface:ServiceConfig
Convert the structured config to a type erased config map.- Specified by:
configMap
in interfaceServiceConfig
- Returns:
- the config map
-