The documentation you are viewing is for Dapr v1.12 which is an older version of Dapr. For up-to-date documentation, see the latest version.

GCP 发布/订阅绑定规范

有关 GCP 发布/订阅绑定组件的详细文档

配置

要开始 Azure 发布/订阅 绑定,需要创建一个类型为 bindings.gcp.pubsub 的组件。 请参阅本指南,了解如何创建和应用绑定配置。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: <NAME>
  namespace: <NAMESPACE>
spec:
  type: bindings.gcp.pubsub
  version: v1
  metadata:
  - name: topic
    value: topic1
  - name: subscription
    value: subscription1
  - name: type
    value: service_account
  - name: project_id
    value: project_111
  - name: private_key_id
    value: *************
  - name: client_email
    value: name@domain.com
  - name: client_id
    value: '1111111111111111'
  - name: auth_uri
    value: https://accounts.google.com/o/oauth2/auth
  - name: token_uri
    value: https://oauth2.googleapis.com/token
  - name: auth_provider_x509_cert_url
    value: https://www.googleapis.com/oauth2/v1/certs
  - name: client_x509_cert_url
    value: https://www.googleapis.com/robot/v1/metadata/x509/<project-name>.iam.gserviceaccount.com
  - name: private_key
    value: PRIVATE KEY

元数据字段规范

字段 必填 绑定支持 详情 示例
topic 输出 GCP 发布/订阅 topic 名称 "topic1"
subscription GCP 发布/订阅订阅名称 "name1"
type 输出 GCP 凭证类型 service_account
project_id 输出 GCP 项目 id project_id
private_key_id 输出 GCP 私钥 id "privateKeyId"
private_key 输出 GCP凭证私钥 替换为x509证书 12345-12345
client_email 输出 GCP 客户端邮箱地址 "client@email.com"
client_id 输出 GCP 客户端 id 0123456789-0123456789
auth_uri 输出 Google帐户 OAuth 端点 https://accounts.google.com/o/oauth2/auth
token_uri 输出 Google帐户token地址 https://oauth2.googleapis.com/token
auth_provider_x509_cert_url 输出 GCP凭证证书地址 https://www.googleapis.com/oauth2/v1/certs
client_x509_cert_url 输出 GCP凭证项目x509证书地址 https://www.googleapis.com/robot/v1/metadata/x509/<PROJECT_NAME>.iam.gserviceaccount.com

绑定支持

此组件支持 输入和输出 绑定接口。

该组件支持如下操作的 输出绑定

  • create

相关链接