S3/SFTP Assets

Instead of storing assets/media (uploaded through the WordPress dashboard) on a single server or in Git, Suzie will upload them to either S3 or SFTP. At first the asset will be uploaded to the server that's in use, then it will be moved to remote storage.

Amazon S3

Let's go through setting up a bucket to use with Suzie. For this example I'll set one up for to use with bigbitecreative.com. First sign up to AWS and go to the S3 section:

alt text

Select Create Bucket:

alt text

Lets enter assets.bigbitecreative.com and I'll select Ireland. And click Create. Once created click on the bucket properties and select Edit bucket policy

alt text

Now we need to give everyone read access. Paste the following in, replacing bucket.name:

      "Principal": "*",

Now click Save. Just like you did with Edit bucket policy, select Add CORS Configuration and paste the following in:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

Now the last thing you will need is your access details to allow WordPress to upload files. At the top of window click on your name (for me Jason Agnew) then Security Credentials. On the left of the new screen select Users:

alt text

Select Create New Users:

alt text

Lets enter WordPress-BigBite and select Create:

alt text

Now take a copy of your Access Key ID and Secret Access Key and click Close

alt text

It's time to give that user access to your S3 bucket. Click Attach Policy

alt text

Select AmazonS3FullAccess then Attach Policy. It's important to note this gives this user access to all buckets so you may which to refine this later. Now we have all the details we need to set up our .env



Now if you want the S3_URL to be http://assets.bigbitecreative.com you can add CNAME to your DNS:

CNAME assets.bigbitecreative.com assets.bigbitecreative.com.s3-eu-west-1.amazonaws.com


Suzie also supports SFTP for storing assets: