Adding IPv6 Support to S3 in AWS SDK

In this post I am going to show how to enable IPv6(dualstack) support Amazon S3 in AWS CLI and on AWS PHP SDK.

To enable IPv6 in CLI, enter the following command:

aws configure set default.s3.use_dualstack_endpoint true

This will enable S3 dualstack endpoints in the CLI.

To enable IPv6 in PHP, add use_dual_stack_endpoint to the array:

 // Enable dualstack endpoint
$s3 = new Aws\S3\S3Client([
'version' => '2006-03-01',
'region' => 'eu-west-1',
'use_dual_stack_endpoint' => true
]);