sunaoka / laravel-ssm-parameters-loader
Load values from AWS SSM Parameter store into environment variables for Laravel
v1.3.2
2024-12-12 09:38 UTC
Requires
- php: ^8.0
- aws/aws-sdk-php: ^3.20.1
- illuminate/cache: ^9.0 || ^10.0 || ^11.0
- illuminate/support: ^9.0 || ^10.0 || ^11.0
- sunaoka/aws-ssm-parameters-loader-php: ^1.0.1
Requires (Dev)
- larastan/larastan: ^2.9.8 || ^3.0.2
- laravel/pint: ^1.5.0
- orchestra/testbench: ^7.45 || ^v8.26 || v9.4
This package is auto-updated.
Last update: 2024-12-12 09:39:07 UTC
README
Load values from AWS SSM Parameter store into environment variables for Laravel
Installation
composer require sunaoka/laravel-ssm-parameters-loader
php artisan vendor:publish --tag=ssm-parameters-loader-config
Usage
Create a SSM Parameter
aws ssm put-parameter --name '/path/to/value' --type String --value 'my secret value'
Set to .env
MY_PARAMETER=ssm:/path/to/value
Example 1
use Sunaoka\LaravelSsmParametersLoader\ParametersLoader; echo env('MY_PARAMETER'); // still 'ssm:/path/to/value' app()->make(ParametersLoader::class)->load(); echo env('MY_PARAMETER'); // my secret value
Example 2
use Sunaoka\LaravelSsmParametersLoader\ParametersLoader; $result = app()->make(ParametersLoader::class)->getParameters(); var_dump($result); // array(1) { // 'MY_PARAMETER' => // string(15) "my secret value" // }