-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add config option [secrets]backends_order #45931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,13 +39,15 @@ When looking up a connection/variable, by default Airflow will search environmen | |
| database second. | ||
|
|
||
| If you enable an alternative secrets backend, it will be searched first, followed by environment variables, | ||
| then metastore. This search ordering is not configurable. Though, in some alternative secrets backend you might have | ||
| then metastore. Though, in some alternative secrets backend you might have | ||
| the option to filter which connection/variable/config is searched in the secret backend. Please look at the | ||
| documentation of the secret backend you are using to see if such option is available. | ||
|
|
||
| On the other hand, if a workers secrets backend is defined, the order of lookup has higher priority for the workers secrets | ||
| backend and then the secrets backend. | ||
|
|
||
| The secrets backends search ordering is also configurable via the configuration option ``[secrets]backends_order``. | ||
|
|
||
| .. warning:: | ||
|
|
||
| When using environment variables or an alternative secrets backend to store secrets or variables, it is possible to create key collisions. | ||
|
|
@@ -64,12 +66,21 @@ The ``[secrets]`` section has the following options: | |
| [secrets] | ||
| backend = | ||
| backend_kwargs = | ||
| backends_order = | ||
|
|
||
| Set ``backend`` to the fully qualified class name of the backend you want to enable. | ||
|
|
||
| You can provide ``backend_kwargs`` with json and it will be passed as kwargs to the ``__init__`` method of | ||
| your secrets backend. | ||
|
|
||
| ``backends_order`` is a comma-separated list of secret backends. These backends will be used in the order they are specified. | ||
| Please note that the ``environment_variable`` and ``metastore`` are required values and cannot be removed | ||
| from the list. Supported values are: | ||
|
|
||
| * ``custom``: Custom secret backend specified in the ``secrets[backend]`` configuration option. | ||
| * ``environment_variable``: Standard environment variable backend ``airflow.secrets.environment_variables.EnvironmentVariablesBackend``. | ||
| * ``metastore``: Standard metastore backend ``airflow.secrets.metastore.MetastoreBackend``. | ||
|
|
||
| If you want to check which secret backend is currently set, you can use ``airflow config get-value secrets backend`` command as in | ||
| the example below. | ||
|
|
||
|
|
@@ -89,13 +100,21 @@ configure separate secrets backend for workers, you can do that using: | |
| [workers] | ||
| secrets_backend = | ||
| secrets_backend_kwargs = | ||
|
|
||
| backends_order = | ||
|
Comment on lines
101
to
+103
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn’t read right? The key implemented here is not under
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @uranusjr ! Thank you for your review and comments! |
||
|
|
||
| Set ``secrets_backend`` to the fully qualified class name of the backend you want to enable. | ||
|
|
||
| You can provide ``secrets_backend_kwargs`` with json and it will be passed as kwargs to the ``__init__`` method of | ||
| your secrets backend for the workers. | ||
|
|
||
| ``backends_order`` is a comma-separated list of secret backends for workers. These backends will be used in the order they are specified. | ||
| Please note that the ``environment_variable`` and ``execution_api`` are required values and cannot be removed | ||
| from the list. Supported values are: | ||
|
|
||
| * ``custom``: Custom secret backend specified in the ``workers[secrets_backend]`` configuration option. | ||
| * ``environment_variable``: Standard environment variable backend ``airflow.secrets.environment_variables.EnvironmentVariablesBackend``. | ||
| * ``execution_api``: Standard execution_api backend ``airflow.sdk.execution_time.secrets.execution_api.ExecutionAPISecretsBackend``. | ||
|
|
||
| If you want to check which secret backend is currently set, you can use ``airflow config get-value workers secrets_backend`` command as in | ||
| the example below. | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.