【发布时间】:2021-01-22 11:20:41
【问题描述】:
有人可以指出我在这里缺少什么吗?我有一个执行这段代码的云函数(按计划触发):
const client = new firestore.v1.FirestoreAdminClient()
const projectId = process.env.GCP_PROJECT || process.env.GCLOUD_PROJECT
const databaseName = client.databasePath(projectId, '(default)')
return client.exportDocuments({name: databaseName, outputUriPrefix: 'gs://BUCKET-NAME', collectionIds: [] })
并在日志中失败:
Error: 7 PERMISSION_DENIED: Service account does not have access to Google Cloud Storage file: /XXX-XXX.
Error details: SERV_ACCOUNT@appspot.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket.
这就是该存储桶的权限设置方式(为了确认,我在大约一个小时前设置并保存了它 - 我刚刚重新打开编辑框以获取图像):
所以,据我所知,SERV_ACCOUNT@appspot.gserviceaccount.com 应该拥有对该存储桶的完全访问权限。但它声称没有。我错过了什么?
【问题讨论】:
标签: google-cloud-firestore google-cloud-functions google-cloud-storage gcloud