Developer
Custom S3 Buckets
5min
purple uses aws to store content 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 to 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 creation of amazon polly tts (text to speech) files, used in the app for the readmode 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 knowledge of terraform is required you will also need to periodically update your setup based on new version of the terraform module in order to avoid interruptions of service if this is not within your capabilities, please contact customer success to arrange for paid support for setup and maintenance through us there are only a handful parameters you need to provide the module will set up 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 terraform provider "aws" { region = "eu central 1" } provider "aws" { alias = "us east 1" region = "us east 1" } data "aws route53 zone" "default" { name = "example com" } module "purple files" { source = "sprylab/purple s3 cloudfront/aws" version = " > 0 0" providers = { aws = aws aws us east 1 = aws us east 1 aws bucket region = aws } \# s3 bucket name = "my purple files 123" bucket iam user name = "my purple files 123" \# cloudfront cloudfront domain = "cdn example com" cloudfront comment = "purple files" \# acm acm certificate name = "purple files" acm zone id = data aws route53 zone default id } once this configuration was applied using terraform, you can configure the custom bucket in the purple managersing the outputs of the terraform module 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 domain module purple files cloudfront distribution domain name or value of cloudfront domain cloudfront public key id module purple files cloudfront public key id setup through sprylab if the setup of the custom s3 bucket should be done by sprylab, the following information is needed aws console login with admin privileges (iam user with admin policy or aws root user) for aws root user we need the email and password note there should not be any 2fa/mfa configured while we perform the initial setup for aws iam user we need the username and password for an iam user that has the awsadministrator policy attached “when you first create an amazon web services (aws) account, you begin with a single sign in identity that has complete access to all aws services and resources in the account this identity is called the aws account root user and is accessed by signing in with the email address and password that you used to create the account ”