Skip to main content

S3

Amazon (AWS) S3 is an object storage service offering industry-leading scalability, data availability, security, and performance. Host your assets in the cloud and serve them using CloudFormation as a CDN.

By using the S3 destination you can immediately send your assets to your own S3 bucket in any region, making it quick and easy to host your assets in your own AWS account.

Setup

Sign up to AWS and create an S3 bucket if you have not already set one up. An AWS access key id and secret are needed to send files to your account. We recommend creating a new user with IAM permissions that only allow access to the buckets needed. Do not use a user with root or global permissions.

The bucket itself also needs permissions to be configured correctly. For example; to allow files to be public use the public-read acl. Once the bucket is created add the access credentials via the Shotstack dashboard.

Adding credentials

Login to the dashboard and navigate to the integrations page, find the S3 destination and click configure.

Enter your access key id and secret key as shown below. You can add different AWS keys for each Shotstack environment; sandbox and v1 (production).

S3 credentials

Integration

Basic integration

To send files to S3 add the following to the output parameter of a render request JSON payload or JSON template:

"destinations": [{
"provider": "s3",
"options": {
"region": "ap-southeast-2",
"bucket": "my-s3-bucket"
}
}]

This will send the rendered files to the my-s3-bucket in the ap-southeast-2 region. The filename will be the render id plus extension, i.e. edc47d30-a504-4f16-8439-24c863a7a782.mp4 and will be saved to the root level of the bucket. Thumbnail and poster images will also be transferred.

Advanced integration

You can also optionally set a prefix (path), custom file name, and set an acl (the default is private):

"destinations": [{
"provider": "s3",
"options": {
"region": "ap-southeast-2",
"bucket": "my-s3-bucket",
"prefix": "testing",
"filename": "video",
"acl": "public-read"
}
}]

This will send the rendered files to the my-s3-bucket in the ap-southeast-2 region. If the rendered file is an mp4, the filename will be video.mp4 and will be saved with a prefix testing. The acl will be set to public-read, which is suitable for public hosting.

When using a custom filename omit the file extension, i.e. .mp4 or .jpg. This will be added based on the rendered file type. If a poster or thumbnail are created these will have -poster.jpg and -thumbnail.jpg appended.

Sending assets to multiple buckets

It is also possible to send files to multiple buckets with one request:

"destinations": [{
"provider": "s3",
"options": {
"region": "ap-southeast-2",
"bucket": "my-s3-bucket"
}
},{
"provider": "s3",
"options": {
"region": "us-east-1",
"bucket": "my-us-s3-bucket"
}
}]

This will send rendered assets to the my-s3-bucket in the ap-southeast-2 region and to the my-us-s3-bucket in the us-east-1 region. Buckets must be in the same AWS account and use the same IAM access credentials.

Opting out from the Shotstack destination

By default all generated files are sent to the Shotstack destination. If you are using S3 you may wish to opt out from hosting your videos with Shotstack using:

"destinations": [{
"provider": "s3",
"options": {
"region": "ap-southeast-2",
"bucket": "my-s3-bucket"
}
},{
"provider": "shotstack",
"exclude": true
}]

This will send the generated video to S3 but not to Shotstack.