blob: 9fa28d8a133f3739aa8fc29af84d08244c0765b4 [file] [log] [blame]
:mod:`airflow.secrets`
======================
.. py:module:: airflow.secrets
.. autoapi-nested-parse::
Secrets framework provides means of getting connection objects from various sources, e.g. the following:
* Environment variables
* Metatsore database
* AWS SSM Parameter store
Submodules
----------
.. toctree::
:titlesonly:
:maxdepth: 1
base_secrets/index.rst
environment_variables/index.rst
local_filesystem/index.rst
metastore/index.rst
Package Contents
----------------
.. py:class:: BaseSecretsBackend(**kwargs)
Abstract base class to retrieve secrets given a conn_id and construct a Connection object
.. attribute:: __metaclass__
.. staticmethod:: build_path(path_prefix, secret_id, sep='/')
Given conn_id, build path for Secrets Backend
:param path_prefix: Prefix of the path to get secret
:type path_prefix: str
:param secret_id: Secret id
:type secret_id: str
:param sep: separator used to concatenate connections_prefix and conn_id. Default: "/"
:type sep: str
.. method:: get_conn_uri(self, conn_id)
Get conn_uri from Secrets Backend
:param conn_id: connection id
:type conn_id: str
.. method:: get_connections(self, conn_id)
Get connections with a specific ID
:param conn_id: connection id
:type conn_id: str
.. method:: get_variable(self, key)
Return value for Airflow Connection
:param key: Variable Key
:return: Variable Value
.. method:: get_config(self, key)
Return value for Airflow Config Key
:param key: Config Key
:return: Config Value
.. function:: get_connections(conn_id) -> List['Connection']
Get all connections as an iterable.
:param conn_id: connection id
:return: array of connections
.. function:: get_variable(key) -> Optional[str]
Get Airflow Variable by iterating over all Secret Backends.
:param key: Variable Key
:return: Variable Value
.. function:: get_custom_secret_backend() -> Optional[BaseSecretsBackend]
Get Secret Backend if defined in airflow.cfg