S3 Provider
Leverage the s3 provider to store files in an s3 compatible file-system.
Use the S3 provider to store files within any S3 compatible file storage service such as AWS S3 or Digital Ocean Spaces.
The S3 provider uses the s3sdk library for all s3 operations.
Keep in mind when using this provider that all file operations result in an outgoing network request from your application. We have utilized various caching techniques to ensure fast operations, but it's good to be mindful of these outgoing requests when working with files and folders.
Configuration
Example
Properties
This provider uses the s3sdk library under the hood, and any of the properties that can be passed in are available, most of which are documented here.
Property | Type | Default | Description |
---|---|---|---|
| boolean |
| |
| boolean |
| |
| string | -- | Your S3 access key |
| string | -- | The domain name used to connect to your s3 service provider |
| string | -- | The region name used to connect to your s3 service provider. Be sure your region is all lowercase, otherwise issues with pre-signed URLs can occur. |
| boolean |
| |
| boolean |
| |
| numeric | 300 | The default timeout of the http operations |
| string |
| Default delimiter to use |
| string | -- | The bucket name, within which this disk operates. |
| string | no-store, no-cache, must-revalidate | |
| string |
| |
| string | -- | Your S3 secret key |
| string |
| |
| string |
| The encoding characterset |
| string | -- | Will be the public domain in URLs generated - for example, when using a CDN distribution via CloudFront |
| numeric |
| |
| string |
| |
| string |
| Which signature encoding to use, |
| boolean |
| Use SSL for all operations |
| boolean |
| |
| string | * | The mime types which are accepted via the upload method. Defaults to all. |
| string | public | Whether the contents of the disk are public (world read ) or private |
Bucket Configuration Considerations
File operations, including the setting of permissions on objects within an AWS bucket require both configuration settings to the bucket and to the user account, in order to all CBFS operations.
User Permissions
In the IAM section of the AWS Manager, your user account should, at minimum have an ACL policy that grants them access to all S3 operations on the bucket. Below is an example of a JSON IAM policy which grants an AWS user access to all bucket operations - including encryption and decryption if that feature is enabled on the bucket:
Bucket Permissions
When creating a bucket to be used with CBFS operations, some initial settings need to be configured, in order for the user you created to perform permissions operations on objects within the bucket. For a non-root user account to perform operations, the following changes to the default configuration must be performed:
Enable ACL's in the Permissions > Object Ownership
Edit Permissions > Block Public Access to allow the IAM users to set their own permissions on objects created. If your bucket is private this will allow the explicit settings for those objects to be peformed.
Note that we have disabled the inheritance settings above, which allows new ACL policies to be created on object, but still disables any cross-account ACL settings, for security.
For public buckets, it is also recommended that you complete the Permissions > CORS section to allow access to your objects only from specific domain referrers.
Last updated