constup-foss/symfony8-aws-secrets-bundle
HttpClient or Process components (or a facade wrapper) would be feasible but requires abstraction.config() system lacks built-in AWS Secrets Manager support; this bundle could bridge that via a custom config loader or service provider.env() system, but AWS Secrets Manager offers runtime retrieval (vs. static .env files).HttpClient for API calls to AWS Secrets Manager (already used in Laravel via Guzzle or Symfony HttpClient bridge).ServiceProvider can mirror bundle registration (e.g., AwsSecretsManagerClient as a singleton).yaml/xml config can be adapted to Laravel’s config/aws.php with minimal effort.Queues or Events could integrate via adapters.DependencyInjection components). Mitigate by wrapping dependencies in Laravel-compatible interfaces.Extension classes).aws/aws-sdk-php v3; Laravel’s guzzlehttp/guzzle or aws/aws-sdk-php v2 could cause conflicts. Test compatibility early.CacheInterface) may not align with Laravel’s Cache facade. Implement a dual-cache strategy (e.g., Redis + AWS TTL).ResourceNotFoundException) need Laravel-friendly exceptions (e.g., AwsSecretsManagerException)..env)?HttpClient, Messenger)? If yes, integration is smoother.env() or augment it (e.g., fallback to AWS if .env is missing)?config:clear.)HttpClient supports mocks; Laravel’s Mockery may need adapters.)| Component | Symfony8 Bundle | Laravel Equivalent/Adapter |
|---|---|---|
| AWS SDK | aws/aws-sdk-php v3 |
guzzlehttp/guzzle or aws/aws-sdk-php v2/3 |
| HTTP Client | symfony/http-client |
Guzzle (native) or Symfony HttpClient bridge |
| Dependency Injection | Symfony’s ContainerInterface |
Laravel’s Illuminate\Container |
| Configuration | YAML/XML | config/aws.php (Laravel) |
| Caching | symfony/cache |
Laravel’s Cache facade |
| Event Bus | Symfony Messenger | Laravel Queues/Events |
Phase 1: Proof of Concept (PoC)
AwsSecretsManager).HttpClient (via symfony/http-client-bundle or standalone) to call AWS API.DB_PASSWORD) retrieved via config('aws.secrets.db_password').Phase 2: Bundle Wrapper
AwsSecretsManagerServiceProvider) to:
AwsSecretsManagerClient as a singleton.CacheInterface to Laravel’s Cache facade.config/aws.php) and migrations (if storing metadata).// app/Providers/AwsSecretsManagerServiceProvider.php
public function register()
{
$this->app->singleton('aws.secrets.client', function () {
return new \Constup\AwsSecretsBundle\Client(
new \Symfony\Component\HttpClient\HttpClient(),
config('aws.secrets.cache') ?? null
);
});
}
Phase 3: Integration with Laravel Ecosystem
config('database.connections.mysql.password') with a dynamic loader:
// config/database.php
'connections' => [
'mysql' => [
'password' => fn() => app('aws.secrets.client')->get('db/mysql/password'),
],
]
.env is missing (e.g., in CI/CD).ConfigCached events.Phase 4: Advanced Features
php artisan aws:rotate-secrets) using the bundle’s rotation logic.Log facade or AWS CloudWatch.aws/aws-sdk-php v3 is compatible with Laravel’s composer.json (may require ^3.0).symfony/http-client) to avoid pulling in Symfony’s full DI container.CacheAdapter works with Laravel’s Cache facade.secretsmanager:GetSecretValue permissions.guzzlehttp/guzzle or symfony/http-client installed.composer require symfony/http-client aws/aws-sdk-php).config/app.php).php artisan vendor:publish --provider="Constup\AwsSecretsBundle\AwsSecretsBundle").config('features.aws_secrets') to toggle integration..env fallback until AWS integration is verified.config/aws.php must stay in sync with bundle defaults.aws/aws-sdk-php and symfony/http-client for breaking changes.Cache facade may need adjustments if Symfony’s CacheInterface evolves.HttpClient errors may not map cleanly to Laravel’s exception handling. Add a custom exception handler:
try {
$secret = app('aws.secrets.client')->get('my
How can I help you explore Laravel packages today?