It looks like your credentials are set up wrong. I'm pretty sure the code you've commented out is the correct way to send to the API, not sure why you've commented them out?
Mar 5, 2020
6
Level 1
S3 Connection Issue
I'm really at wits end here.
I'm getting this issue but I'm 99% sure I've done everything correctly.
Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1004 milliseconds
When I'm uploading a file
$image = $request->file('media');
Storage::disk('s3')->put($folder, file_get_contents($image));
Here is my filesystems file
's3' => [
'driver' => 's3',
'version' => 'latest',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
// 'credentials' => [
// 'key' => env('AWS_ACCESS_KEY_ID'),
// 'secret' => env('AWS_SECRET_ACCESS_KEY'),
// ],
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
Here is my .env shortend. Also copied keys directly from IAM Bucket name copied directly from https://console.aws.amazon.com/s3/home?region=us-east-1
AWS_ACCESS_KEY=AKIA....
AWS_SECRET_ACCESS=lKYE....
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=.........
AWS_URL=https://bucket-name.region.amazonaws.com
Lastly, here are my packages
"league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-cached-adapter": "~1.0",
"league/flysystem-sftp": "~1.0",
Level 1
So, I feel dumb, my env variables weren't the same as the filesystems....
Changed
AWS_ACCESS_KEY to AWS_ACCESS_KEY_ID
etc...
Please or to participate in this conversation.