Answers.Body: <p>I found a solution that lets you overwrites the core file S3.php without touching the core files.</p>
  
  <p>By adding this snippet to config/general.php  </p>
  
  <pre><code>// S3 override  
  const BUCKET_NAME = 'YOUR BUCKET NAME';  
  require_once('../craft/plugins/gm/S3.php');  
  
  return array(  
     ...  
  );  
  </code></pre>
  
  <p>And duplicate the S3.php file and add it to the plugins folder you can make the needed changes.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-22T11:10:23.150Z
Answers.Text: That is clever. Not clean, but definitely clever.
Answers.UserDisplayName: Andris Sevcenko
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-22T15:57:35.860Z
Answers.Text: I know, but as long as it works and is simple for the front-end developers here.
Answers.UserDisplayName: Petter
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-22T11:00:35.993Z
Answers.LastActivityDate: 2017-02-22T17:29:19.807Z
Answers.LastEditDate: 2017-02-22T17:29:19.807Z
Answers.UserDisplayName: Petter
Answers.Body: <p>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 <code>craft_assetsources</code> table in database.</p>
  
  <p>This is <a href="https://github.com/craftcms/docs/blob/master/en/configuration.md#overriding-volume-settings" rel="nofollow noreferrer">improved</a> in Craft 3, so, yay!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-22T11:11:42.680Z
Answers.LastActivityDate: 2017-02-22T11:11:42.680Z
Answers.UserDisplayName: Andris Sevcenko
Body: <p>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?</p>
  
Tags: <s3>
Title: Craft on Heroku with buckateer as a middleman for Amazon S3
ThreadText: # Craft on Heroku with buckateer as a middleman for Amazon S3
  
  (Asked by: username_0 on 2017-02-21)
  
  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?
  
  **Tags:** s3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-02-22. Score: 2 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_1**: That is clever. Not clean, but definitely clever.  
  > **username_0**: I know, but as long as it works and is simple for the front-end developers here.  
  
  ---
  
  ### Answer by username_1 on 2017-02-22. Score: 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](https://github.com/craftcms/docs/blob/master/en/configuration.md#overriding-volume-settings) in Craft 3, so, yay!
  
  
  ---
  
  