wieni / flysystem_s3
Installs: 2 701
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:drupal-module
Requires
- drupal/core: ^9 || ^10
- drupal/flysystem: ^2.1@rc
- league/flysystem: ^1.0.20
- league/flysystem-aws-s3-v3: ^1.0, !=1.0.12, !=1.0.13
README
For setup instructions see the Flysystem README.md.
CONFIGURATION
The region needs to be set to the region id, not the region name. Here is a list of the region names and their corresponding ids:
The s3-cors-example.json
file has a template you can use to configure CORS
using the REST API or the aws s3api put-bucket-cors
command.
Example configuration:
$schemes = [ 's3' => [ 'driver' => 's3', 'config' => [ 'key' => '[your key]', // 'key' and 'secret' do not need to be 'secret' => '[your secret]', // provided if using IAM roles. 'region' => '[aws-region-id]', 'bucket' => '[bucket-name]', // Optional configuration settings. // 'options' => [ // 'ACL' => 'public-read', // 'StorageClass' => 'REDUCED_REDUNDANCY', // ], // 'protocol' => 'https', // Autodetected based on the // current request if not // provided. // 'prefix' => 'an/optional/prefix', // Directory prefix for all // uploaded/viewed files. // 'cname' => 'static.example.com', // A CNAME that resolves to // your bucket. Used for URL // generation. // 'cname_is_bucket' => TRUE, // Set to FALSE if the CNAME // does not resolve to a // bucket and the bucuket // should be included in the // path. // 'endpoint' => 'https://api.example.com', // An alternative API endpoint // for 3rd party S3 providers. // 'public' => TRUE, // Set to TRUE to link to files // using direct links. // 'cors' => TRUE, // Set to TRUE if CORS upload // support is enabled for the // bucket. ], 'cache' => TRUE, // Creates a metadata cache to speed up lookups. ], ]; $settings['flysystem'] = $schemes;