AWS is a module targeted towards module developers that provides a unified AWS profile management system. Profiles follow the same conventions as their CLI counterparts and serve the same purpose.

By default, when you load an AWS service it will initialize using the default profile for that service (configured at /admin/config/services/aws). You can initialize a service with a different profile by using the setProfile() method on the client factory instance.

/** @var \Drupal\aws\Entity\ProfileInterface $profile */
$profile = \Drupal::entityTypeManager()->getStorage('aws_profile')->load('alternate_profile');

/** @var \Drupal\aws\AwsClientFactoryInterface $client_factory */
$client_factory = \Drupal::service('aws.client_factory');

/** @var \Aws\S3\S3Client $default_s3 */
$default_s3 = $client_factory->getClient('s3');

/** @var \Aws\S3\S3Client $alternate_s3 */
$alternate_s3 = $client_factory->setProfile($profile)->getClient('s3');

Services

All services supported by the AWS SDK for PHP are supported by this module. For a complete list, see https://docs.aws.amazon.com/aws-sdk-php/v3/api/.

Supporting organizations: 

Project information

Releases