dcotelo / aws-secret-dbdriver
Easy db auth from aws secret manager
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/dcotelo/aws-secret-dbdriver
Requires
- aws/aws-sdk-php: ^3.128
- aws/aws-sdk-php-laravel: ^3.4
- guzzlehttp/guzzle: ^6.4
This package is auto-updated.
Last update: 2025-10-18 06:46:01 UTC
README
Features
- Ready to go database driver for AWS secret manager
Install
Composer install
$ composer require dcotelo/aws-secret-dbdriver
Load secrets in AWS Secret Manager as key/value pairs
Naming convention:  <env>/<appname>/<conn_name> 
Ex: stage/Blog/mysql
Database configuration
Database configuration  config/database.php .
'connections' => [
    'mysql' => [
        'driver' => 'secret-db',
    ],
Minimum secret attributes 
{ "database": "blog_database", "driver": "mysql", "host": "127.0.0.1", "password": "*******", "port": "3306", "username": "mysql_user" }
Cache configuration
Default configuration keep the credentials in cache for 5 minutes customizable in  .env  file.
DB_CACHE_TIME=<minutes>
AWS Credentials
In order to consume saved secrets aws credentials must be configured in  .env
Ex:
AWS_ACCESS_KEY_ID=<KEY>
AWS_SECRET_ACCESS_KEY=<SECRET>
AWS_REGION=<REGION>