use AwsS3S3Client;
use LeagueFlysystemAwsS3v2AwsS3Adapter;
use LeagueFlysystemFilesystem;
$client = S3Client::factory(array(
'key' => '[your key]',
'secret' => '[your secret]',
'region' => '[aws-region]',
));
$adapter = new AwsS3Adapter($client, 'bucket-name', 'optional-prefix');
$filesystem = new Filesystem($adapter);