humanmade / altis-cloud

Cloud Module for Altis
https://docs.altis-dxp.com/cloud/
9 stars 2 forks source link

Set the S3 Endpoint correctly #877

Open joehoyle opened 4 months ago

joehoyle commented 4 months ago

Altis infra uses the global s3 endpoint of s3.amazonaws.com for all region's s3 buckets. Things like S3_Uploads::get_s3_location_for_url() also assumes a global hardcoded hostname. However, if you try to generate URLs with the SDK, it will generate $bucket.s3.$region.amazonaws.com (with the exception of us-east-1, which defaults to the global hostname) style URLs. That's an issue for things like S3 Uploads Private Media as the signature will then not match.

We should make sure that the SDK's S3Client is set to use the global hostname to ensure compatibility with the rest of the Altis infra.