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(conn_id)[source]¶

Return URI representation of Connection conn_id.

Parameters

conn_id (str) – the connection id

Returns

deserialized Connection

Return type

str | None

get_conn_value(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(key)[source]¶

Get Airflow Variable from Environment Variable.

Parameters

key (str) – Variable Key

Returns

Variable Value

Return type

str | None

Was this entry helpful?