-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# AWS Secret Manager db driver | ||
|
||
### 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: `<appname>/<env>/<conn_name> ` | ||
**Ex: Blog/stage/mysql** | ||
|
||
|
||
#### Database configuration | ||
|
||
Database configuration `config/database.php` . | ||
|
||
'connections' => [ | ||
|
||
'mysql' => [ | ||
'driver' => 'secret-db', | ||
], | ||
|
||
|
||
|
||
#### Minimum secret attributes | ||
|
||
```javascript | ||
{ | ||
"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> |