2

We are using Craft on Heroku and wants to use S3. The problem is that we want to use a Heroku element (buckateer) as a middleman. Buckateer only gives you an IAM user without listbuckets permissions. So you get "S3::listBuckets(): [AccessDenied] Access Denied". Is there a smart and easy way to set the bucket manually without going into the core files?

2 Answers 2

2

Sorry, there's not a clean way of doing that in Craft 2. What you can do, though, is manually create an entry for the Asset Source in the craft_assetsources table in database.

This is improved in Craft 3, so, yay!

2

I found a solution that lets you overwrites the core file S3.php without touching the core files.

By adding this snippet to config/general.php

// S3 override  
const BUCKET_NAME = 'YOUR BUCKET NAME';  
require_once('../craft/plugins/gm/S3.php');  

return array(  
   ...  
);  

And duplicate the S3.php file and add it to the plugins folder you can make the needed changes.

2
  • That is clever. Not clean, but definitely clever. Feb 22, 2017 at 11:10
  • I know, but as long as it works and is simple for the front-end developers here.
    – Petter
    Feb 22, 2017 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.