- Newest
- Most votes
- Most comments
Hello,
I have not specifically used Active Storage for S3, but when working with Dynamo or other databases I have found that the URL for end points vs access can differ. Given that HTTP 301 errors usually indicate a redirection this may be a good place to start. In the context of AWS S3, this may mean that the request is being made to the wrong endpoint. When using S3 Access Points, I believe the endpoint URL structure is different from the standard S3 bucket URL structure. The standard structure is https://bucket-name.s3.region.amazonaws.com, but for access points, the structure is https://access-point-name-123456789012.s3-accesspoint.region.amazonaws.com.
It's possible that the AWS SDK for Ruby is not correctly handling the Access Point alias and is trying to use the standard bucket URL structure, leading to the 301 redirect error. You might need to manually specify the correct endpoint URL when creating the S3 client in your Ruby code.
Maybe adding a line like:
s3 = Aws::S3::Resource.new(region: 'us-west-2', endpoint: 'https://access-point-name-123456789012.s3-accesspoint.region.amazonaws.com')
Hopefully this can add a starting point!
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Hi Zac,
The thing is, with Object Lambda AP Aliases, the expected URL structure is indeed as if it were a bucket, not an Access Point. Citing the AWS article I mentioned before:
"Aliases [...] are interchangeable with bucket names anywhere you use a bucket name to access data stored in Amazon S3. Therefore, your applications don’t need to know about S3 Object Lambda and can consider the alias to be a bucket name."
So it should not be an issue with the URL formation in the Ruby AWS SDK, as the URL should have the same format that always worked for us. Hope I made myself clear enough.