rauchfuss-io/gcpsecretmanager-envvarprocessor

A small Symfony Custom EnvVarProcessor bundle for retrieving Secrets from GCP Secret Manager

v1.1.6 2020-09-03 10:18 UTC

This package is auto-updated.

Last update: 2024-04-29 04:21:18 UTC


README

What is this EnvVarProcessor for the GCP Secret Manager?

This bundle will help you to retrieve secrets from GCP Secret Manager on runtime. Define this service within your Symfony services.yaml by adding the following:

Rauchfussio\GCPSecretManagerEnvVarProcessor\:
    resource: '../vendor/rauchfuss-io/gcpsecretmanager-envvarprocessor/src/*'
    tags: ['container.env_var_processor']
    arguments:
        $gcpProjectId: 'YOUR GCP PROJECTID'
        $gcpCredentialsFile: 'YOUR SERVICE ACCOUNT PRIVATE KEY'

Now you can define which secrets you want to request on runtime:

App\Controller\DefaultController:
    class: 'App\Controller\DefaultController'
    arguments:
        $secret: '%env(string:gcpsecretmanager:YOURSECRET)%'

Installation

  • Require the bundle with composer:
composer require rauchfuss-io/gcpsecretmanager-envvarprocessor