Key AWS is an extension to the Key module.
This module provides a new key provider for supporting authentication against AWS. The new key provider allows you to specify a path to the AWS credentials file. The key provider and included service, will help parse and also provide easy access to this data.
Requirements
Requires the Key module.
Install
Install key_aws using a standard method for installing a contributed Drupal module, either by downloading the package or using composer.
composer require drupal/key_aws
drush en key_aws
Usage
AWS Credentials
This is the preferred method.
This method requires a AWS credentials file.
For information about the credentials file, please see: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
- Start off by going to the "Manage Keys" page:
/admin/config/system/keys - Add new key.
- Specify internal name to easily identify key.
- For key type, select "AWS".
- For key provider, select "AWS Credentials".
- Specify your path to your AWS credentials file.
- Save key.
AWS S3 Configuration
Requires submodule key_aws_s3 to be enabled.
- Start off by going to the "Manage Keys" page: /admin/config/system/keys
- Add new key.
- Specify internal name to easily identify key.
- For key type, select "AWS S3".
- For key provider, select "AWS Configuration".
- Specify access and secret keys.
- Save key.
AWS Key Repository Service
Module provides AWS Key Repository service which you can inject into your own classes. See below for usage examples:
// Get service. Can be injected into class as well.
$awsKeyRepository = \Drupal::service('key_aws.repository');
// Set key which is pointing to your AWS credentials file.
$keyName = 'aws_creds_key';
$awsKeyRepository->setKey($keyName);
// Get credentials. Return an array of keys.
$credentials = $awsKeyRepository->getCredentials();
// Get access key.
$accessKey = $awsKeyRepository->getAccessKey();
// Get secret key.
$secretKey = $awsKeyRepository->getSecretKey();
Project information
- Ecosystem: Key
149 sites report using this module
- Created by geoanders on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.



