Dataflow pipline选项的服务帐户凭据

时间:2017-03-01 15:44:07

标签: google-cloud-dataflow apache-beam

从Dataflow 1.9升级到Beam 0.4.0。 GcpOptions上设置服务帐户名称(setServiceAccountName)和密钥文件(setServiceAccountKeyFile)的方法不再可用。最接近的替代方案是setGcpCredential

要手动创建GoogleCredential,要使用的适当范围是什么?我的管道需要访问PubSub,Datastore和BigQuery,可能是云存储。

new GoogleCredential.Builder()
    .setTransport(HTTP_TRANSPORT)
    .setJsonFactory(JSON_FACTORY)
    .setServiceAccountId(serviceAccount)
    .setServiceAccountScopes(SCOPES)  // what will be the scopes?
    .setServiceAccountPrivateKeyFromP12File(p12file)
    .build();

1 个答案:

答案 0 :(得分:1)

我相信基于this list,所有这些都应该可以通过https://www.googleapis.com/auth/cloud-platform范围访问。

相关问题