You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/howto/use-alternative-secrets-backend.rst
+86-23Lines changed: 86 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -383,48 +383,76 @@ Note that the secret ``Key`` is ``value``, and secret ``Value`` is ``world`` and
383
383
384
384
.. _secret_manager_backend:
385
385
386
-
GCP Secret Manager Backend
387
-
^^^^^^^^^^^^^^^^^^^^^^^^^^
386
+
Google Cloud Secret Manager Backend
387
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
388
388
389
-
To enable GCP Secrets Manager to retrieve connection/variables, specify :py:class:`~airflow.providers.google.cloud.secrets.secret_manager.CloudSecretManagerBackend`
390
-
as the ``backend`` in ``[secrets]`` section of ``airflow.cfg``.
389
+
This topic describes how to configure Airflow to use `Secret Manager <https://cloud.google.com/secret-manager/docs>`__ as
390
+
a secret backend and how to manage secrets.
391
391
392
-
Available parameters to ``backend_kwargs``:
392
+
Before you begin
393
+
""""""""""""""""
393
394
394
-
* ``connections_prefix``: Specifies the prefix of the secret to read to get Connections.
395
-
* ``variables_prefix``: Specifies the prefix of the secret to read to get Variables.
396
-
* ``gcp_key_path``: Path to GCP Credential JSON file
* ``sep``: Separator used to concatenate connections_prefix and conn_id. Default: "-"
436
+
* ``project_id``: Project ID to read the secrets from. If not passed, the project ID from credentials will be used.
437
+
438
+
All options should be passed as a JSON dictionary.
439
+
440
+
For example, if you want to set parameter ``connections_prefix`` to ``"airflow-tenant-primary"`` and parameter ``variables_prefix`` to ``"variables_prefix"``, your configuration file should look like this:
When ``gcp_key_path`` is not provided, it will use the Application Default Credentials (ADC) to obtain credentials.
453
+
* By default, Application Default Credentials (ADC) is used obtain credentials.
454
+
* ``gcp_key_path`` option in ``backend_kwargs`` option - allows you to configure authorizations with a service account stored in local file.
455
+
* ``gcp_keyfile_dict`` option in ``backend_kwargs`` option - allows you to configure authorizations with a service account stored in Airflow configuration.
428
456
429
457
.. note::
430
458
@@ -433,8 +461,43 @@ When ``gcp_key_path`` is not provided, it will use the Application Default Crede
0 commit comments