Skip to content

S3 Upload Provider

This provider uses the S3 protocol to store files. Note that you do not need to use AWS, any S3-compatible provider will work.

To configure the S3 upload provider, add the following to your config.yaml:

yaml
uploads:
  s3:
    bucket_name: my-bucket-name
    access_key: xxxxxxxxxxxxxxxxxxxx
    secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    bucket_region: us-east-2

    # (Optional)
    endpoint: http://localhost:9000

    # (Optional, Default: false)
    # Whether to use path style addressing for S3 requests
    path_style: true

    # (Optional)
    # Prefix to prepend to all keys in the S3 bucket
    prefix: rhombus/

    # (Optional)
    # If set, creates presign GETs for this many seconds. Otherwise
    # will generate the url for the asset assuming it is public for
    # anonymous users
    presigned_get_expiry: 3600

    # (Optional)
    # Profile to use from the AWS credentials file
    profile: default

    # (Optional)
    security_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    # (Optional)
    session_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Use environment variables instead of writing secrets in plaintext as usual:

  • RHOMBUS__UPLOADS__S3__BUCKET_NAME
  • RHOMBUS__UPLOADS__S3__ACCESS_KEY
  • RHOMBUS__UPLOADS__S3__SECRET_KEY
  • RHOMBUS__UPLOADS__S3__BUCKET_REGION