如何授予气流访问权限以在 Google Cloud Storage Bucket 中创建数据?

How to grant airflow access to create data in Google Cloud Storage Bucket?

我创建了一个将 MySQL 数据导出到 Google 云存储桶的 DAG。

我收到以下错误,我无权从 airflow 创建 .json 文件。

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery_cache/init.py", line 41, in autodetect from . import file_cache

File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 41, in 'file_cache is unavailable when using oauth2client >= 4.0.0')

ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 [2018-01-10 16:18:52,584] {discovery.py:274} INFO - URL being requested: GET https://www.googleapis.com/discovery/v1/apis/storage/v1/rest

[2018-01-10 16:18:52,585] {transport.py:157} INFO - Attempting refresh to obtain initial access_token

[2018-01-10 16:18:52,661] {client.py:777} INFO - Refreshing access_token

[2018-01-10 16:18:53,698] {_helpers.py:132} WARNING - init() takes at most 2 positional arguments (3 given)

[2018-01-10 16:18:53,712] {discovery.py:872} INFO - URL being requested: POST https://www.googleapis.com/upload/storage/v1/b/podio-reader-storage/o?uploadType=media&alt=json&name=phones_schema.json

[2018-01-10 16:18:54,936] {http.py:120} WARNING - Encountered 403 Forbidden with reason "forbidden"

[2018-01-10 16:18:54,936] {models.py:1417} ERROR - https://www.googleapis.com/upload/storage/v1/b/podio-reader-storage/o?uploadType=media&alt=json&name=phones_schema.json returned "podio-reader-service1-717@podio-data.iam.gserviceaccount.com does not have storage.objects.create access to podio-reader-storage/phones_schema.json.">

我与 Google 云平台的气流连接是:

有人知道如何解决这个问题吗?

通过允许我的凭据密钥完全控制访问云存储解决了这个问题