Custom S3 Buckets
Purple uses AWS to store contents for all apps by default. The default storage location is in Europe (eu-west-1) and is distributed by AWS Cloudfront as it's CDN.
There may be reasons why you would want to manage your storage yourselves:
- Your consumers are located in different parts of the world. Do reduce latencies it may be beneficial to have your S3 storage in a different region
- You want to keep track of the costs for the content delivery
- Your internal or external policies require you to manage the storage yourself
Purple supports this by allowing you to configure the storage for your team.
We offer an official Terraform module which takes care of configuring all the necessary resources automatically.
There are only a handful parameters you need to provide. The module will setup an
- S3 bucket
- AWS Cloudfront distribution
- Lambda@Edge with Tachyon for dynamic image resizing
- and optionally an AWS ACM certificate for the Cloudfront distribution, if you want to use a custom CDN domain.
The following example sets up a bucket in eu-central-1 and configures cdn.example.com as the Cloudfront domain.
Example
Once this configuration was applied using Terraform, you can configure the custom bucket in the Purple Manager like this:
Configuration | Value |
Bucket Access Key | module.purple_files.s3_access_key |
Bucket Secret Key | module.purple_files.s3_secret_key |
Bucket Name | module.purple_files.s3_bucket_id |
Bucket Base Directory | leave empty |
Bucket Region | eu-central-1 |
Cloudfront URL | module.purple_files.cloudfront_distribution_domain_name or value of cloudfront_domain |
Cloudfront Access Key | module.purple_files.cloudfront_public_key_id |