Skip to content

Collects endpoint, region, credentials and default bucket. Anything not given as an argument comes from an option, then from the environment, then from the default:

Usage

s3_config(
  endpoint = NULL,
  region = NULL,
  access_key = NULL,
  secret_key = NULL,
  session_token = NULL,
  bucket = NULL,
  timeout = NULL,
  max_tries = NULL,
  multipart_threshold = NULL,
  part_size = NULL
)

Arguments

endpoint

scheme://host[:port], no path. Missing endpoint is an error when a request is made, not here.

region

Signing region; us-east-1 is what most self-hosted stores (MinIO, Garage, Ceph) expect.

access_key, secret_key

Credentials. Missing credentials are an error when a request is made, not here.

session_token

Session token of temporary credentials.

bucket

Bucket used when a key is not an s3://bucket/key URL.

timeout

Time limit of one call, in seconds.

max_tries

Attempts per call (the first one included).

multipart_threshold

Bodies larger than this many bytes are uploaded in parts (write_s3(), upload_s3()).

part_size

Size of each part, in bytes (at least 5 MiB).

Value

An object of class s3pe_config. Printing it never shows the secret key.

Details

SettingOptionEnvironmentDefault
endpoints3pe.endpointS3PE_ENDPOINT, AWS_ENDPOINT_URLrequired
regions3pe.regionAWS_REGION, AWS_DEFAULT_REGIONus-east-1
access_keyAWS_ACCESS_KEY_IDrequired
secret_keyAWS_SECRET_ACCESS_KEYrequired
session_tokenAWS_SESSION_TOKENnone
buckets3pe.bucketS3PE_BUCKETnone
timeouts3pe.timeout300 s
max_triess3pe.max_tries3
multipart_thresholds3pe.multipart_thresholdS3PE_MULTIPART_THRESHOLD64 MiB
part_sizes3pe.part_sizeS3PE_PART_SIZE16 MiB (at least 5 MiB)

Keep credentials in ~/.Renviron (R reads it at start-up), never in scripts. The endpoint has no default: set it once per machine (S3PE_ENDPOINT) or per session (use_endpoint()). URLs are always path-style (endpoint/bucket/key), which every S3-compatible store accepts.

Examples

if (FALSE) { # interactive()
s3_config()
cfg <- s3_config(endpoint = "https://s3.example.org", bucket = "my-bucket")
list_s3("data/", config = cfg)
}