TappNetwork / laravel-aws-secrets-manager

Manage environment secrets using AWS Secrets Manager.
MIT License
36 stars 20 forks source link

Update env vars before being set in config #27

Open gilbitron opened 4 months ago

gilbitron commented 4 months ago

Manually maintaining the list of config variables that need to be overridden in variables-config is cumbersome and a headache for larger projects. Would there be a way to inject the environment variables before the config is set? Maybe using a command to pull and set the variables in the environment before running php artisan config:cache? So you could do something like this:

php artisan fetch-secrets-from-aws
php artisan config:cache
devsi commented 6 days ago

I agree with this too. On larger projects, often config files like services.php or similar will contain accessors via config() en-masse. Maintaining a second list of all of these as dot notated accessors for the specific array is a real nightmare.