首页 > 解决方案 > 发布/订阅主题的 GCP 服务帐户访问问题

问题描述

我当前在 GCP 中的设置包括一个到 Pub/Sub 主题的日志接收器,它将某些医疗保健 API 日志条目导出到第三方日志工具。尽管我认为拥有所有必需的权限,但活动页面显示 Stackdriver 配置错误以及类似这样的错误消息

Access to the topic was denied
The specified topic does not allow the service account associated with the log sink to publish to it. Grant publish permission for the service account specified in the sink's writerIdentity field on the topic.

现在有问题的服务帐户已经分配了以下一组权限

Healthcare Dataset Administrator
Healthcare FHIR Resource Editor
Healthcare FHIR Resource Reader
Healthcare FHIR Store Administrator
Service Account Admin
Service Account Key Admin
Service Account User
Workload Identity User
Logs Configuration Writer
Logs Writer
Pub/Sub Editor
Pub/Sub Publisher

根据这个线程,它是一个已知问题,但它已经超过了那里提到的 24 小时阈值,所以我有点困惑。

我在这里缺少任何特殊权限吗?我曾尝试过一次或两次重新创建水槽,但没有用。感谢社区对此提供的任何帮助。谢谢。

编辑: 这是我在跑步时发现的gcloud logging sinks describe <sink name>

createTime: '2021-02-23T00:42:35.363983703Z'
destination: <PUBSUB_TOPIC>
filter: resource.labels.service="healthcare.googleapis.com"
name: <SINK_NAME>
updateTime: '2021-03-01T18:44:50.694055502Z'
writerIdentity: <SA_NAME>

标签: google-cloud-platformpermissionsservice-accountsstackdriver

解决方案


推荐阅读