Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache airflow define data for all scripts in DAG folder

Tags:

airflow

I have data like Amazon S3 connection settings etc.. which is relevant for many of the .py files in my DAG folder.

I'm aware that default_args is shared with all DAGS in a specific .py file My question is how can I define data which will be accessible for ALL .py files on my DAG folder?

Imagine that I need to change my S3 connection details... I don't want to go over all files and change it one by one. I want to change it just in one place.

Does Airflow support this?

like image 635
jack Avatar asked Sep 11 '26 03:09

jack


1 Answers

This is precisely the use case for the Connection model. Instead of passing around sensitive information, namely credentials, you create a Connection record which holds that information on your behalf and which you reference with a string.

You can read more about them here.

like image 64
joebeeson Avatar answered Sep 12 '26 17:09

joebeeson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!