This package allows you to fetch your secrets from AWS Secrets Manager.
You can install the package via composer:
composer require codingmonkeys/secrets-manager
The secrets manager package uses the following environment variables:
DB_CONNECTION=mysql
AWS_DEFAULT_REGION=eu-central-1
SECRETS_MANAGER_ROLE=arn:aws:iam::123456789012:role/role-name
SECRETS_MANAGER_ROLE_SESSION_NAME=role-session-name
SECRETS_MANAGER_AWS_ACCOUNT_ID=123456789012
SECRETS_MANAGER_ENVIRONMENT=dev
SECRETS_MANAGER_CACHE_TIMEOUT=60
Please note: SECRETS_MANAGER_CACHE_TIMEOUT is the number of minutes the secrets are cached.
In AppServiceProvider, paste this line in the boot method:
$secretsManager = app('secrets-manager')->getSecrets();
$secrets = $secretsManager->secrets;