Asset uploads
If the user drops in any image, audio, video or GIF, they are uploaded to cloud storage so that rendering in the cloud can be performed later.
By default, S3 is used for cloud storage, which requires some setup.
Setup
- Visit the S3 console.
- Create a new bucket.
- Uncheck the "Block all public access" checkbox.
- Switch the default setting and set ACLs enabled - if you don't do this, you will get a 400 error when later uploading assets.
- In the bucket settings, go to the "Permissions" tab and enter the following policy into the "CORS" section:
json
[{"AllowedHeaders": ["*"],"AllowedMethods": ["PUT", "GET", "HEAD"],"AllowedOrigins": ["*"],"ExposeHeaders": [],"MaxAgeSeconds": 3000}]
- Go to IAM -> "Users" in the AWS console.
- Create a new user with all settings left as default.
- Click "Add permissions -> Add inline policy" and add the following policy:
json
{"Version": "2012-10-17","Statement": [{"Sid": "Presign","Effect": "Allow","Action": ["s3:PutObject", "s3:PutObjectAcl"],"Resource": ["arn:aws:s3:::YOUR_BUCKET_NAME/*"]}]}
note
Make sure to replace YOUR_BUCKET_NAME
with the name of your bucket.
- Click "Security credentials".
- Click "Create access key". Select "CLI" as use case.
- Save your access key and secret access key.
In your .env
file, fill now the following variables:
txt
REMOTION_AWS_ACCESS_KEY_ID=REMOTION_AWS_SECRET_ACCESS_KEY=REMOTION_AWS_REGION=REMOTION_AWS_BUCKET_NAME=
note
The same environment variables are also used for rendering in the cloud.
Now, restart the Editor Starter.
When you drop in an asset, it should be uploaded to the S3 bucket!