Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating connection outside of Airflow GUI

I would like to create S3 connection without interacting Airflow GUI. Is it possible through airflow.cfg or command line?

We are using AWS role and following connection parameter works for us: {"aws_account_id":"xxxx","role_arn":"yyyyy"}

So, manually creating connection on GUI for S3 is working, now we want to automate this process and want to add it as part of the Airflow deployment process. Any work around?

like image 674
dreamer Avatar asked Jun 22 '17 18:06

dreamer


1 Answers

You can use the airflow CLI. Unfortunately there is no support for editing connections, so you would have to remove and add as part of your deployment process, e.g.:

airflow connections -d --conn_id 'aws_default'
airflow connections -a --conn_id 'aws_default' --conn_uri 'aws:' --conn_extra '{"region_name": "eu-west-1"}'
like image 57
andresp Avatar answered Oct 14 '22 19:10

andresp