【发布时间】:2021-08-13 15:25:59
【问题描述】:
我正在 Cloud Composer 中设置一个 DAG,它会触发许多 Cloud Run 和 Cloud Function 服务。 Cloud Composer 环境中指定的服务帐户(用户创建的 SA)肯定有权调用 Cloud Run 和 Cloud Function 服务,但是 Cloud Run 函数给出以下错误:
The request was not authenticated. Either allow unauthenticated invocations or set the proper Authorization header. Read more at https://cloud.google.com/run/docs/securing/authenticating
任务是这样的:
#t1 as request first report
big3_request = SimpleHttpOperator(
task_id= "big3_request",
method='GET',
http_conn_id='trigger_cloud_run_service_conversions_big_3',
endpoint='',
response_check = lambda response: True if response == ("ok", 200) else False
)
我原以为云作曲家环境可以使用服务帐户 IAM 角色,但事实并非如此。我需要在这里做什么才能使服务运行?看起来我可以将服务帐户的密钥文件添加到连接中,但我不明白如果在 CC 环境中使用相同的服务帐户,为什么需要这样做?
【问题讨论】:
标签: google-cloud-platform airflow google-cloud-composer