Amazon S3 bucket as media source

Hi all,

I have a site which has a lot of high res images.
I have create an Amazon S3 bucket, to use as a media source, but I cannot get it working.
In the settings for the media source, it’s asking for a URL, but I’m not entirely sure where to get the URL? I haev the bucket name and the region set, but I’ve tried but these but nothing shows when i try and browse the media source:

https://myaccount.s3.amazonaws.com/
https://s3.amazonaws.com/myaccount/

I’ve tried replacing ‘myaccount’ with the name of the bucket, but that doesn’t work either.

Just wondered if there’s someone on here familiar with Amazon S3 who can point me in the right direction - I’ve never used it before, and the backed is very cimplicated so not sure where I’m looking!

Thanks!
Andy

I think it should be…

https://bucketname.s3.amazonaws.com

Thanks - I already tried this too though. The problem is there’s no errors so i can’t see where the issue is.

What part don’t you get working? IIRC, the url is only for the frontend (and could also be a CloudFront url for example).

If you can’t get any files listed, there is also a newer S3 integration available as an extra that’s needed for the Frankfurt (and possibly other) zone due to newer signature requirements.

In MODX3 the core one has been updated but you’ll probably need the extra for 2.x.

Good point Mark. nothing loads when i try to browse the media source.
I’ll check the extras for the s3 integration and will report back

I have searched the extras and cannot find anything relating to s3 in there. I’ve also searched google in case it’s from the third party, but can’t find anything there either.

Huh, I’d swear that was available from the provider. @matdave or @theboxer do you know what happened there?

There’s a package available on GitHub though (_packages directory); you can download that and upload it through the package manager to install: GitHub - modxcms/aws-s3-media-source

Ah Ok - I’ll take a look - thanks Mark!

So that works - I can now see the files in my bucket - yipee!
But - I cannot uplaod to it from MODX. This might be out of the scope of this forum, but I have never used Amazon S3 - do I need to enable something at their end to allow uploads from modx? I can’t rename anything or modify anything from modx.

Any ideas?

Thanks
Andy

You’ll have to give the AWS user the right permissions; sounds like you’re lacking PutObject (IIRC).

Thanks Mark. I found the permissions in AWS and added the administrator policy (for testing) which has full access to everything. have deleted the core > cache folder and relogged in. Still cannot upload/rename/remove anything in the bucket.