silverstripe / silverstripe-s3

Silverstripe module to store assets in S3 rather than on the local filesystem (SS4/SS5 only)
BSD 3-Clause "New" or "Revised" License
20 stars 25 forks source link

Configuration / compatibility? #13

Closed PixelDog closed 6 years ago

PixelDog commented 7 years ago

Is this compatible with CMS & Framework v4.0.0-beta3? I've defined following configuration values in mysite/_config.php:

AWS_REGION: The AWS region your S3 bucket is hosted in (e.g. eu-central-1) AWS_BUCKET_NAME: The name of the S3 bucket to store assets in. AWS_ACCESS_KEY_ID: Your AWS access key that has access to the bucket you want to access AWS_SECRET_ACCESS_KEY

assets are still stored and referenced from the local assets, on the front end and in the content editor. I don't see anything going to S3. Am I missing a configuration value or any other step in setting this up?

chillu commented 6 years ago

Hmm, I've just installed it on 4.0.x-dev and it works like a charm. I've assigned an IAM role with S3 access to my EC2 instance instead of using explicit access key and secret configurations. But didn't have to configure anything else, was picked up automatically. I don't think anything changed since beta3 there, but could you try again please? Agree that we need a better way to determine if this has been set up correctly and is active (dev/build?)

MightyMerio commented 6 years ago

Any chance for a quick pointer? I am not quite seeing where to add the config settings. Do they go in the top level .env file, or config yml or _config.php, and what would be the syntax? edited to add: when used in .env i get this error: "Uncaught Aws\Exception\CredentialsException: Error retrieving credentials from the instance profile metadata server." I think I have the right vars in there :( Also, I am not doing this via EC2. Just using S3 by itself.

MightyMerio commented 6 years ago

Solved this. I am using MAMP PRO. The env variables simply need to be added to the vhost in hosts tab.

screen shot 2018-07-17 at 11 23 53 am
MightyMerio commented 6 years ago

By the way, the S3 Module works absolutely amazingly on SS 4.1 ! Thank you for the incredible work on this! :-) 👍