Download the PHP package constup-foss/symfony8-aws-secrets-bundle without Composer
On this page you can find all versions of the php package constup-foss/symfony8-aws-secrets-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download constup-foss/symfony8-aws-secrets-bundle
More information about constup-foss/symfony8-aws-secrets-bundle
Files in constup-foss/symfony8-aws-secrets-bundle
Package symfony8-aws-secrets-bundle
Short Description Symfony bundle for AWS Secrets Manager integration.
License MIT
Homepage https://github.com/constup-foss/symfony-aws-secrets-bundle
Informations about the package symfony8-aws-secrets-bundle
= constUP Symfony AWS Secrets Manager Bundle :toc: :toclevels: 5
image:https://img.shields.io/badge/PHP-8.4-blue[Static Badge] image:https://img.shields.io/badge/Symfony-8-purple[Static Badge] image:https://img.shields.io/badge/License-MIT-green[Static Badge] image:https://img.shields.io/packagist/dt/constup-foss/symfony8-aws-secrets-bundle[Packagist Downloads]
== Description
Use AWS Secrets as service container parameter values in Symfony 8.
[NOTE]
Thank you for more than 200.000 Packagist downloads of the previous bundle that supported Symfony 5 and 6 (link:https://github.com/constup-foss/aws-secrets-bundle[AWS Secrets Bundle]). I hope it served you well!
If you are using this library, please take a couple of seconds to star it on GitHub. I have abandoned the development of the previous version because there was barely any feedback. I thought no one uses it. I've only found out that it was widely used after checking it on Packagist after a couple of years.
Each star gives me motivation to continue. Thanks!
== Prerequisites
=== PHP and Symfony versions
This bundle is intended to be used on Symfony 8 and PHP 8.4+ (requirement by Symfony 8).
.Note about future support [%collapsible]
New versions of Symfony will have their own bundles. This significantly reduces complexity when managing updates for the bundle. This bundle may or may not be compatible with Symfony 9 or any other future version. It is intended to be used on Symfony 8 only.
=== Install AWS SDK PHP v3
You need to install AWS SDK for PHP in your project:
[source]
composer require aws/aws-sdk-php
.Context [%collapsible]
Symfony's best practices for reusable bundles contain the following statement:
[quote]
A bundle must not embed third-party PHP libraries. It should rely on the standard Symfony autoloading instead.
This is to avoid having different bundles providing different versions of the same SDK.
====
== Installation
[source]
composer require constup-foss/symfony8-aws-secrets-bundle
== Configuration
=== Bundle configuration
By default, configuration for this bundle is loaded from config/packages/symfony8_aws_secrets.yaml (or its
environment-specific location like config/packages/test/symfony8_aws_secrets.yaml).
Available configuration properties:
[source,yaml]
symfony8_aws_secrets: client_config: region: version: endpoint: profile: credentials: key: secret: token: delimiter: ignore:
Detailed configuration documentation is available here: link:doc/configuration.adoc[Configuration].
=== AWS authentication
This bundle supports several methods of authentication:
- by loading a
profilefrom your~/.awsdirectory - by using long-term credentials (
AccessKeyIdandSecretAccessKey) from your AWS IAM user - by using temporary AWS STS tokens
link:doc/configuration.adoc[Configuration] documentation page describes how to configure this bundle for each method of authentication.
link:doc/aws_credentials_and_authentication.adoc[AWS credentials and authentication] documentation page describes authenticating in different environments, including how to configure a dockerized AWS CodeBuild pipeline.
== Use
Set an environment variable (for example, in your .env file):
[source,dotenv]
YOUR_AWS_SECRET_VARIABLE="your_secret_name_as_saved_in_secret_manager"
This will usually grab a secret in JSON format. To get the value of a specific key from that JSON response, list it after a comma:
[source,dotenv]
YOUR_AWS_SECRET_VARIABLE="your_secret_name_as_saved_in_secret_manager","your_secrets_json_property"
Set the value of a Symfony service container parameter to the value of your environment variable with
symfony8_aws_secrets processor applied:
.config/services.yaml [source,yaml]
parameters: your_parameter: "%env(symfony8_aws_secrets:YOUR_AWS_SECRET_VARIABLE)%"
Your secret will now be loaded at runtime.
=== More examples
- link:doc/doctrine_mysql_example.adoc[Configure DoctrineORM to use AWS Secret Manager values as MySQL connection parameters]
== Development, testing and contribution
Development, testing and contribution guide is available on a separate link:doc/development_and_maintenance.adoc[documentation page].
== License
MIT License
- License file: link:LICENSE.txt[LICENSE.txt]
- Online version: https://opensource.org/license/mit
== Supporting development
If you like this library or find it useful, consider buying me a nice cup of coffee. Coffee fuels open source.
image:doc/bmac.png[width=197]
All versions of symfony8-aws-secrets-bundle with dependencies
ext-curl Version *
symfony/dependency-injection Version ^8.0
symfony/http-kernel Version ^8.0
symfony/config Version ^8.0
symfony/cache Version ^8.0