Download the PHP package doobert/aws-secrets-manager without Composer
On this page you can find all versions of the php package doobert/aws-secrets-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download doobert/aws-secrets-manager
More information about doobert/aws-secrets-manager
Files in doobert/aws-secrets-manager
Package aws-secrets-manager
Short Description Laravel package for AWS Secrets Manager integration.
License MIT
Informations about the package aws-secrets-manager
AWS Secrets Manager for Laravel
Seamless integration with AWS Secrets Manager for Laravel. Caching, atomic locking, flexible config mapping, and easy setup.
🚀 Installation
Install via Composer:
If not auto-discovered, add the service provider to config/app.php:
Publish the configuration file:
⚙️ Configuration
Edit config/aws-secrets-manager.php or set these in your .env:
| Key | Description | Default |
|---|---|---|
| enabled | Enable/disable the package | true |
| check_latency | Log cache/AWS latency | false |
| region | AWS region for Secrets Manager | us-west-2 |
| cache_ttl | Cache lifetime (seconds) | 3600 |
| cache_store | Laravel cache store to use (e.g., redis) | redis |
| name | AWS secret name | (empty) |
| log_channel | Log channel for package logs | awssecrets |
| load_in_console | Load secrets when running artisan/console | false |
| keys_raw | Map secret keys to config (see below) | false |
Example .env:
🛠 Usage
Inject or resolve the service:
Mapping Secrets to Config
Mapping Secrets to Config
Set AWS_SECRETS_KEYS_RAW or aws-secrets-manager.keys_raw to map secret keys to Laravel config values:
Format: SECRET_KEY:config.path, comma-separated for multiple pairs. This will automatically set config values at runtime.
Load in Console
Set AWS_SECRETS_LOAD_IN_CONSOLE=true to load secrets when running artisan/console commands (disabled by default for performance).
📋 Logging
All logs are sent to the channel defined in log_channel (default: awssecrets). If not set, logs go to the default Laravel log channel.
Refreshing the secrets in Cache
🛡 Artisan Command: Refresh Secrets
You can manually refresh and cache your AWS secret after rotation using the included artisan command:
This will force a fresh fetch from AWS Secrets Manager and update the cache. Useful after rotating secrets in AWS.
Options:
--all(future use): Refresh all configured secrets.
Example output:
If the secret cannot be fetched, you’ll see an error message with troubleshooting tips.
✅ Testing
From the package directory:
📦 Requirements
- Laravel 8.0+
- PHP 8.0+
- AWS SDK for PHP
📄 License
MIT
All versions of aws-secrets-manager with dependencies
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
aws/aws-sdk-php Version ^3.0