The AWS S3 Storage uploads all files to S3 Buckets. Depending on the type of file, they are served differently. Media files (public and private) are served directly by S3. either served directly by amazon s3 (by injecting the links directly into the webpage) or via the application server.
To enable the S3 storage engine, first find and set the following variables in your values.yaml
:
fileStorageConfig: host: # enable storing uploads on the hosts file system enabled: false # Specify the absolute path to a directory on the filesystem where uploads should be stored path: $UPLOADS_DIR s3: enabled: true region: publicBucket: privateBucket: uploadsBucket: accessKey: secretKey:
To Configure the Buckets that are going to be used with the following variables.
First, use these settings to configure the S3 Storage for the media files:
Settings Key | Possible Values | Description |
---|---|---|
| An AWS Region, eg | Specify the region of the S3 Bucket |
| A valid S3-Bucket name | The name of the bucket that holds the public media files |
| A valid S3-Bucket name | The name of the bucket that holds the private media files |
| A valid S3-Bucket name | The name of the bucket that holds the uploads (eg - 3D files) |
| Any String | The access key of the IAM user that should access the private and public media buckets |
| Any String | The secret key of the IAM user that should access the private and public media buckets |
Bucket Permissions
You will need to specify a bucket for each of the 3 different file types. We suggest you create one bucket for each. Each of the buckets would need to have the following ACL set:
Public Media:
ACL=public-read
Private Media:
ACL=private
3D files:
ACL=private
Furthermore, you will need to give an IAM user ( or an IAM Role ) full access to all buckets and permission to list all available buckets. To do so, attach the following IAM policy to the entity that's accessing the buckets:
{ "Version": "2012-10-17", "Statement": [{ "Action": "s3:*", "Effect": "Allow", "Resource": [ "arn:aws:s3:::<<Public-Media-Bucket>>", "arn:aws:s3:::<<Public-Media-Bucket>>/*", "arn:aws:s3:::<<Private-Media-Bucket>>", "arn:aws:s3:::<<Private-Media-Bucket>>/*", "arn:aws:s3:::<<3D-Files-Bucket>>", "arn:aws:s3:::<<3D-Files-Bucket>>/*" ] }, { "Effect": "Allow", "Action": "s3:ListAllMyBuckets", "Resource": "arn:aws:s3:::*" } ] }