Skip to content

A Laravel package for fetching secrets from AWS Secrets Manager

License

Notifications You must be signed in to change notification settings

coding-monkeys-bv/secrets-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel AWS Secrets Manager

This package allows you to fetch your secrets from AWS Secrets Manager.

Installation

You can install the package via composer:

composer require codingmonkeys/secrets-manager

Usage

Configuration

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.

Implementation

In AppServiceProvider, paste this line in the boot method:

$secretsManager = app('secrets-manager')->getSecrets();
$secrets = $secretsManager->secrets;