airflow.secrets.environment_variables

Objects relating to sourcing connections from environment variables

Module Contents

Classes

EnvironmentVariablesBackend

Retrieves Connection object and Variable from environment variable.

Attributes

CONN_ENV_PREFIX

VAR_ENV_PREFIX

airflow.secrets.environment_variables.CONN_ENV_PREFIX = AIRFLOW_CONN_[source]
airflow.secrets.environment_variables.VAR_ENV_PREFIX = AIRFLOW_VAR_[source]
class airflow.secrets.environment_variables.EnvironmentVariablesBackend[source]

Bases: airflow.secrets.BaseSecretsBackend

Retrieves Connection object and Variable from environment variable.

get_conn_uri(self, conn_id)[source]

Return URI representation of Connection conn_id :param conn_id: the connection id :return: deserialized Connection

get_conn_value(self, conn_id)[source]

Retrieve from Secrets Backend a string value representing the Connection object.

If the client your secrets backend uses already returns a python dict, you should override get_connection instead.

Parameters

conn_id (str) -- connection id

get_variable(self, key)[source]

Get Airflow Variable from Environment Variable

Parameters

key (str) -- Variable Key

Returns

Variable Value

Return type

Optional[str]

Was this entry helpful?