本文介绍了在Airflow GUI外部创建连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不与Airflow GUI交互的情况下创建S3连接。是否可以通过airflow.cfg或命令行使用?

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

我们正在使用AWS角色,并且以下连接参数对我们有用:
{ aws_account_id: xxxx , role_arn: yyyyy}

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

因此,在GUI上为S3手动创建连接是可行的,现在我们要自动化该过程并将其添加为气流部署过程的一部分。可以解决吗?

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?

推荐答案

您可以使用气流CLI。不幸的是,不支持编辑连接,因此您必须在部署过程中删除和添加,例如:

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"}'

这篇关于在Airflow GUI外部创建连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 10:08