CodeSleeve / stapler

ORM-based file upload package for php.
http://codesleeve.com
Other
538 stars 144 forks source link

S3 "Error retrieving credentials from the instance profile metadata server" when using url() method #192

Open Hitunen opened 6 years ago

Hitunen commented 6 years ago

Had said problem using laravel 5, stapler and laravel-stapler with S3 (outside EC2), and thought to report my 5c here in case it's a pain for someone else.

What resolved the issue for me was moving key & secret under a credentials array: From

's3_client_config' => [
    'key' => '',
    'secret' => '',
    'region' => '',
    'scheme' => 'http',
],

to

's3_client_config' => [
    'credentials' => [
        'key' => '',
        'secret' => '',
    ],
    'region' => '',
    'scheme' => 'http',
],

and changing Validator.php's validateS3Options() to validate the changed options instead. (Naturally, i also updated the config file values.)