Closed (fixed)
Project:
S3 Client
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Aug 2025 at 12:21 UTC
Updated:
1 Oct 2025 at 07:55 UTC
Jump to comment: Most recent
Thanks for your simple but powerfull integration of aws s3 client. This module could provide a way to fully customize client's options to use this module with other providers than AWS.
We need to be able to change the endpoint, maybe the version :
/**
* @see https://stackoverflow.com/a/71709116/9266823
*/
$client = new Aws\S3\S3Client([
'version' => 'latest',
'region' => 'bucketregion', //eg. 'fr-par'
'credentials' => [
'key' => 'your access key',
'secret' => 'your secret key',
],
'endpoint' => 'http://mybucket.s3.fr-par.scw.cloud',
'bucket_endpoint' => true
]);
Try to use the module to access a bucket on another provider than AWS.
We can imagine having a new "endpoint" variable, but I think a fully customisable option array would be an overall solution that can cover all needs (If we need to touch the version for example).
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
colin.eininger commentedComment #6
colin.eininger commentedfix typo in title
Comment #7
larowlanSeems reasonable to me.
Can you provide a snippet of docs for the additional settings that I can add to the project page on merge?
Comment #8
colin.eininger commentedThanks for reviewing the MR.
Here are the snippets to update the project page.
Configuration
Injecting the factory
Comment #10
larowlanThanks, I'll cut a 1.2.0 release and add the above to the docs page
Comment #12
larowlanhttps://www.drupal.org/project/s3client/releases/1.2.0
Comment #14
colin.eininger commentedThanks for your quick actions
Comment #15
acbramley commentedFYI this change means sites without a key or secret set (e.g for local or CI environments) you'll get a PHP fatal error
TypeError: Drupal\s3client\S3ClientFactory::createClient(): Argument #2 ($secret)orTypeError: Drupal\s3client\S3ClientFactory::createClient(): Argument #1 ($key)Comment #16
colin.eininger commentedSorry, I did not realised it was a use case. Adding nullable declaration to the $key and $secret types of createClient should do the trick. Before my modifications, Credentials could be instanciated with null values. Another solution is to add an empty string as default settings for s3client.default_key and s3client.default_secret.
Maybe in case of no key and/or secret given we can skip the credentials option ?