Docs / Contact / connectors/gcp-pubsub
Google Pub/Sub
Provider:gcp| Service:pubsub| Direction: Write
Google Cloud Pub/Sub connector for publishing messages to a topic.
Required Permissions#
The service account must have:
| Operation | Required Permission | Predefined Role |
|---|---|---|
| Publish | pubsub.topics.publish |
Pub/Sub Publisher |
Tip: Grant the role at the topic level for least privilege rather than at the project level.
Operation#
When a message reaches this connector, it publishes to the configured topic. The payload must supply:
| Payload field | Required | Description |
|---|---|---|
message |
Yes | Message body to publish |
Connector Configuration#
The connector is created with type: "cloud", provider: "gcp", service_type: "pubsub", plus:
Field (config) |
Required | Description |
|---|---|---|
project_id |
Yes | Google Cloud project ID |
credentials |
Yes | Service account JSON credentials (use ${secrets.gcp_credentials}). |
topic_id |
Yes | Pub/Sub topic ID |
Output#
json
{
"status": "completed",
"data": {
"status": "published"
}
}
Example#
Connector config (service account):
json
{
"type": "cloud",
"provider": "gcp",
"service_type": "pubsub",
"project_id": "my-gcp-project",
"credentials": "${secrets.gcp_credentials}",
"topic_id": "device-events"
}
Tendrl