supportbook/ssm-parameters-bundle
Symfony bundle for integrating AWS Systems Manager Parameter Store (SSM) into your app, making it easy to load and manage configuration parameters, including secure values, through Symfony’s configuration system.
This is a Symfony bundle, not a Laravel package. A Laravel developer should treat it as a reference implementation or only use it inside a Symfony service that sits next to a Laravel app. If you are working in Laravel, start with aws/aws-sdk-php and a small config loader instead of installing this bundle directly.
Minimal steps if you are in a Symfony project:
composer require supportbook/ssm-parameters-bundleconfig/bundles.phpconfig/packages/*.yaml/myapp/dev/database/password and inject it into a service or parameter bag.Look first at:
First useful use case: remove database credentials and third-party API keys from .env files and load them from AWS Systems Manager Parameter Store at deploy or container boot time.
For Laravel, the equivalent first step is a custom service provider or bootstrap file that calls SsmClient::getParameter() and merges the result into config(). Do not assume Symfony bundle auto-discovery works in Laravel.
Use hierarchical parameter names that mirror environments:
/myapp/prod/db/host/myapp/prod/db/password/myapp/staging/db/passwordLoad parameters once during application boot, then expose them through the framework's config system. In Symfony this is typically done through the bundle's parameter resolution; in Laravel use a service provider, a cached config file, or a deployment step that writes resolved values into environment variables.
Common workflows:
.env or a generated config file. This avoids runtime AWS calls and keeps local development simple.GetParametersByPath for a prefix such as /myapp/prod/ and map the leaf names to config keys.SecureString and let IAM/KMS handle decryption.APP_ENV=local, read from .env; in production, read from SSM. Keep the same config keys in both paths.Laravel integration pattern:
// app/Providers/SecretsServiceProvider.php
use Aws\Ssm\SsmClient;
public function boot()
{
if (app()->environment('local')) {
return;
}
$ssm = new SsmClient([
'region' => config('services.aws.region'),
'version' => 'latest',
]);
$result = $ssm->getParametersByPath([
'Path' => '/myapp/' . app()->environment() . '/',
'WithDecryption' => true,
'Recursive' => true,
]);
foreach ($result['Parameters'] as $parameter) {
$key = str_replace('/', '.', trim($parameter['Name'], '/'));
config([$key => $parameter['Value']]);
}
}
Keep the SSM path convention stable across services. A parameter named /myapp/prod/db/password should always map to database.connections.mysql.password or another explicit key, not depend on implicit string replacement.
ssm:GetParameter, ssm:GetParameters, ssm:GetParametersByPath, and kms:Decrypt for SecureString parameters.aws ssm get-parameter --name ... --with-decryption..env fallback and fail only in non-local environments when parameters are missing.AccessDenied or ParameterNotFound, and use aws ssm describe-parameters to confirm names. In Symfony, check the container compilation and bundle config; in Laravel, check that your service provider runs early enough.SsmClient and cache layer. In Laravel, the equivalent extension point is your own service provider and a small SsmConfigRepository class.How can I help you explore Laravel packages today?