Aws-sdk-php: Support for S3 Transfer Acceleration?

Created on 11 Sep 2017  路  2Comments  路  Source: aws/aws-sdk-php

Does this SDK support S3 Transfer Acceleration? The docs on AWS don't seem to indicate that it supports it directly. But it seems like it should be as easy as changing the domain name of the s3 service. Unfortunately, seeing a custom domain name within the S3 leads to some odd errors.

Is there a better way to supports S3 Transfer Acceleration, or does that just not work in the PHP SDK?

guidance

Most helpful comment

use Aws\S3\S3Client;
// set the arguments properly        
$option_ar = array(
            'version'   => 'latest',
            'region'    => 'eu-west-1',
            'credentials' => array(
                'key'    => awsAccessKey,
                'secret' => awsSecretKey,
            ),
            'use_accelerate_endpoint' => true // before use transfer accelerator, you must enabled this from your bucket properties.
        );
        $s3 = new S3Client($option_ar);

All 2 comments

S3 Transfer Acceleration is done through 'use_accelerate_endpoint' and 'use_dual_stack_endpoint' options on the S3Client that can also be configured at a per-operation level.

use Aws\S3\S3Client;
// set the arguments properly        
$option_ar = array(
            'version'   => 'latest',
            'region'    => 'eu-west-1',
            'credentials' => array(
                'key'    => awsAccessKey,
                'secret' => awsSecretKey,
            ),
            'use_accelerate_endpoint' => true // before use transfer accelerator, you must enabled this from your bucket properties.
        );
        $s3 = new S3Client($option_ar);
Was this page helpful?
0 / 5 - 0 ratings