This package is a fork from Minio.jl. This is also not an official Cloudflare package.

This package provides Julia tools for working with Cloudflare R2. Cloudflare R2 is fully compatible with the AWS S3 interface, so interaction with R2 is achieved through AWSS3.jl. This package simply contains some convenient constructors to set up the configuration to be used with AWSS3.jl.


The package itself can be installed with


or ]add CloudflareR2 in the REPL.


This package provides a AbstractAWSConfig object to be used with Cloudflare R2. This allows seamless integration with the AWSS3.jl package.


A configuration object allowing to use the AWS S3 interface from AWS.jl and AWSS3.jl with Cloudflare R2. You can generate your access key ID and secret access key from the R2 dashboard, as well as your account ID from the Cloudflare dashboard.


# By passing only your Cloudflare account ID
R2Config(account_id; access_key_id, secret_access_key, region)
R2Config(account_id, creds; region)

# By passing the endpoint directly
using URIs

R2Config(URI(endpoint); access_key_id, secret_access_key, region)
R2Config(URI(endpoint), creds; region)


  • account_id: Your Cloudflare account ID. This will be used to construct the endpoint URL.
  • endpoint: Your Cloudflare S3 API endpoint.
  • creds: An AWSCredentials object providing the credentials to access R2.
  • access_key_id: An access key ID for Cloudflare R2. This will use R2_ACCESS_KEY_ID or AWS_ACCESS_KEY_ID if available.
  • secret_access_key: A secret access key for Cloudflare R2. This will use R2_SECRET_ACCESS_KEY or AWS_SECRET_ACCESS_KEY if available.
  • region: The region to use. Defaults to "auto". Valid values are "auto", "wnam", "enam", "weur", "eeur", and "apac".


using R2

# tokens are read from environment
# region set to auto
config = R2Config("YOUR_ACCOUNT_ID")

# using the AWS S3 API

# using the S3Path interface
path = S3Path("s3://bucket-name", config=config)