countxvat / aws-secrets-bundle
Loads ENV vars from AWS Secrets Manager
Installs: 6 251
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.1
- ext-json: *
- aws/aws-sdk-php: ^3.62
- symfony/dependency-injection: ^3.4 | ^4.0 | ^5.0
Requires (Dev)
- friends-of-behat/symfony-extension: ^v2.3.1
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5.26
- roave/security-advisories: dev-master
- symfony/framework-bundle: ^3.4 | ^4.0 | ^5.0
- symfony/phpunit-bridge: *
README
Easy loading of AWS Secrets Manager Secrets for Symfony
Installation
$ composer require countxvat/aws-secrets-bundle
Configuration
aws_secrets: client_config: region: # required if ignore is false version: 'latest' # defaults to latest credentials: key: ~ secret: ~ cache: 'array' # one of apcu, array, filesystem, default is array delimiter: ',' # delimiter to separate key from secret name ignore: false # pass through aws (for local dev environments set to true)
Usage
Set an env var to an AWS Secret Manager Secret name like so:
AWS_SECRET=secret_name
If you want to grab a key in a JSON secret, you can seperate the secret name and key:
AWS_SECRET=secret_name,key
Set a parameter to this environment variable with the aws processor:
parameters: my_parameter: '%env(aws:AWS_SECRET)%'
Your secret will now be loaded at runtime!