Google Cloud Pub/Sub Component
Manage topics, subscriptions, and messages in Google Cloud Pub/Sub.
Component key: google-cloud-pub-sub
Description
Google Cloud Pub/Sub is a messaging service from Google Cloud Platform for asynchronous communication between applications. The Google Cloud Pub/Sub component allows you to create, update, delete, and list topics and subscriptions, as well as publish and pull messages.
API Documentation
This component was built using the Google Cloud Pub/Sub REST API currently utilizing v1.
The Push Notifications service lets you to receive notifications that an order has been created. This is called "push" since Google will push notifications to you about events, such as orders, that happen on the Google side.
-
The Content API's
pubsubnotificationsettings.updatereceives the request and sends you back acloudTopicName. -
To configure additional Topics
- In the Google Cloud console, select the navigation menu scroll to the Pub/Sub page (Navigation Menu > More Products > Analytics > Pub/Sub)
- In the Topics page, click Create Topic
- In the window that opens, enter
MyTopicin the Topic ID field.- Leave the default values for the remaining options, and then click Create.
- You see the success message:
A new topic and a new subscription have been successfully created. - You have just created a topic called
MyTopicand an associated default subscriptionMyTopic-sub.
- In the window that opens, enter
-
You create a subscription for the topic and register the URL push endpoint with Cloud Pub/Sub.
-
To Configure Subscription go to Pub/Sub > Subscriptions
- In the Subscriptions page, click Create subscription.
- Enter
MySubin the Subscription ID field. - For Select a Cloud Pub/Sub topic, select the
MyTopictopic from the drop-down menu - Leave the default values for the remaining options.
- Click Create
- You see the success message:
Subscription successfully added.
- You see the success message:
- Click the Topics page and click
MyTopic.-
The
MySubsubscription is now attached to the topicMyTopic. Pub/Sub delivers all messages sent toMyTopicto theMySubandMyTopic-subsubscriptions.
-
-
Cloud Pub/Sub accepts your subscription and associates that
cloudTopicNamewith your URL. When messages are published to thatcloudTopicName(for example, your order notifications), they will be sent to your URL push endpoint.
Request
PUT https://shoppingcontent.googleapis.com/content/v2.1/merchantId/pubsubnotificationsettings
Connections
OAuth2
All requests to the Google Cloud Pub/Sub API must be authorized by an authenticated user.
To create a Google Cloud Pub/Sub OAuth 2.0 connection, configure an OAuth application in the Google Cloud Console.
Prerequisites
- A Google Cloud account with access to create projects and credentials
- A Google Cloud project (or the ability to create one)
Setup Steps
- Navigate to the Google Cloud Console and select or create a project
- From APIs & Services > Library, search for and enable the Cloud Pub/Sub API
- Navigate to APIs & Services > Credentials and select Create Credentials
- Choose OAuth client ID
- If this is the first time creating credentials, configure the OAuth consent screen:
- Enter an App name (company or product name)
- Provide a User support email
- Add App logo, Application home page, and Authorized domains as needed
- Enter Developer contact information
- On the Scopes screen, select Add Or Remove Scopes:
- Search for "Pub/Sub" and add the following scopes:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/pubsub
- Refer to Google's OAuth 2.0 Scopes documentation for additional scope information
- Search for "Pub/Sub" and add the following scopes:
- Return to Create OAuth client ID:
- Under Application type select Web application
- Provide a Name for the OAuth client
- Under Authorized redirect URIs click Add URI and enter:
https://oauth2.prismatic.io/callback - Click CREATE
- Copy the Client ID and Client Secret from the confirmation dialog
The Client ID and Client Secret can be retrieved later from APIs & Services > Credentials under the OAuth 2.0 Client IDs section by selecting the name of the OAuth client.
Configure the Connection
- Enter the Client ID and Client Secret from the OAuth client created above
- For Scopes, use the following value:
https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/pubsub
| Input | Notes | Example |
|---|---|---|
| Authorize URL | The authorization URL for Google Cloud Pub/Sub OAuth 2.0. | https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent |
| Client ID | The Client ID from the Google Cloud OAuth 2.0 credentials. | 123456789012-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com |
| Client Secret | The Client Secret from the Google Cloud OAuth 2.0 credentials. | GOCSPX-abcdefghijklmnopqrstuvwxyz |
| Scopes | Space-delimited list of OAuth 2.0 scopes. See OAuth 2.0 Scopes for Google APIs for more information. | https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/pubsub |
| Token URL | The token URL for Google Cloud Pub/Sub OAuth 2.0. | https://oauth2.googleapis.com/token |
Google Pub/Sub Private Key
| Input | Notes | Example |
|---|---|---|
| Client Email | The service account email address from the Google Cloud service account JSON key file. | my-service-account@my-project.iam.gserviceaccount.com |
| Private Key | The private key from the Google Cloud service account JSON key file. This should be the entire key value including the BEGIN and END markers. | |
| Project ID | The Google Cloud project ID that contains the Pub/Sub resources. | my-gcp-project-123456 |
| Scopes | Space-delimited list of OAuth 2.0 scopes. See OAuth 2.0 Scopes for Google APIs for more information. | https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/pubsub |
Triggers
PubSub Notification
PubSub Notification Trigger Settings | key: myTrigger
Data Sources
Fetch subscriptions
Fetch an array of subscriptions | key: subscriptions | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Page Size | The maximum number of results to return per page. | 100 |
| Page Token | The page token returned by a previous list call to request the next page of results. | DBsPVgscdHRpdWhSGwQLQVd- |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
{
"result": [
{
"label": "projects/{project}/subscriptions/{subscription} / projects/{project}/topics/{topic}",
"key": "projects/{project}/subscriptions/{subscription}"
}
]
}
Fetch Topics
Fetch an array of topics | key: topics | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Page Size | The maximum number of results to return per page. | 100 |
| Page Token | The page token returned by a previous list call to request the next page of results. | DBsPVgscdHRpdWhSGwQLQVd- |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
{
"result": [
{
"label": "projects/{project}/topics/{topic}.",
"key": "projects/{project}/topics/{topic}."
}
]
}
Actions
Create Subscription
Creates a subscription to a given topic. | key: createSubscription
| Input | Notes | Example |
|---|---|---|
| Ack Deadline Seconds | The time (in seconds) Pub/Sub waits for acknowledgment before resending the message. Must be between 10 and 600 seconds. Default is 10 seconds if not specified. | 60 |
| BigQuery Config | Configuration for BigQuery delivery. See BigQueryConfig for more information. | |
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Dead Letter Policy | Policy for dead lettering undeliverable messages. See Dead Letter Topics for more information. | |
| Detached | When true, the subscription is detached from its topic and will not receive messages or retain backlog. | false |
| Enable Exactly Once Delivery | When true, Pub/Sub guarantees exactly-once delivery semantics for messages on this subscription. | false |
| Enable Message Ordering | When true, messages with the same orderingKey are delivered to subscribers in the order they are received by Pub/Sub. | false |
| Expiration Policy | Policy specifying when the subscription expires. Default TTL is 31 days if not set. See ExpirationPolicy for more information. | |
| Filter | A filter expression to select which messages are delivered. See Filtering Messages for syntax. | attributes.environment = "production" |
| Labels | Labels to organize and group resources. See Creating and Updating Labels for more information. | |
| Message Retention Duration | The minimum duration to retain a message after publication. Must be between 10 minutes (600s) and 31 days (2678400s). Format: duration in seconds with up to nine fractional digits, ending with 's' (e.g., '3600s' for 1 hour). | 86400s |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Push Config | Configuration for push delivery. See PushConfig for more information. | |
| Retain Acked Messages | When true, acknowledged messages are retained in the subscription's backlog until they fall outside the messageRetentionDuration window. Required for seeking to past timestamps. | false |
| Retry Policy | Policy for retrying message delivery. See RetryPolicy for more information. | |
| State | Output-only field indicating whether the subscription can receive messages. | ACTIVE |
| Subscription | The name of the subscription to create. | my-subscription |
| Topic | The name of the topic from which this subscription is receiving messages. The value of this field will be deleted-topic if the topic has been deleted. | my-topic |
| Topic Message Retention Duration | Output-only field indicating the minimum duration messages are retained in the topic. Format: duration in seconds ending with 's' (e.g., '86400s'). | 86400s |
| Topic Name or Full Format | Select whether the topic input is a full resource path (e.g., 'projects/my-project/topics/my-topic') or just the topic name (e.g., 'my-topic'). |
Create Topic
Creates the given topic with the given name. | key: createTopic
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| KMS Key Name | The resource name of the Cloud KMS CryptoKey used to protect access to messages published on this topic. See Customer-Managed Encryption Keys for more information. | projects/my-project/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key |
| Labels | Labels to organize and group resources. See Creating and Updating Labels for more information. | |
| Message Retention Duration | The minimum duration to retain a message after publication. Must be between 10 minutes (600s) and 31 days (2678400s). Format: duration in seconds with up to nine fractional digits, ending with 's' (e.g., '3600s' for 1 hour). | 86400s |
| Message Storage Policy | Policy constraining the Google Cloud regions where messages may be stored. See Message Storage Policy for more information. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Satisfies PZS | When true, indicates the topic satisfies physical zone separation. This is an output-only field reserved for future use. | false |
| Schema Settings | Settings for validating messages against a schema. See Schema Settings for more information. | |
| Topic | Name of the new topic | my-topic |
{
"data": {
"name": "projects/my-gcp-project-123456/topics/order-events",
"labels": {
"environment": "production",
"team": "engineering",
"cost_center": "cc-1234"
},
"messageStoragePolicy": {
"allowedPersistenceRegions": [
"us-east1",
"us-west1"
]
},
"kmsKeyName": "projects/my-gcp-project-123456/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key",
"schemaSettings": {
"schema": "projects/my-gcp-project-123456/schemas/order-schema",
"encoding": "JSON",
"firstRevisionId": "1a2b3c4d",
"lastRevisionId": "5e6f7g8h"
},
"satisfiesPzs": false,
"messageRetentionDuration": "86400s",
"alreadyExisted": false
}
}
Create Webhook Subscription
Creates a webhook subscription to a given topic. | key: createWebhookSubscription
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Subscription Name | The name of the subscription to create. | ASubscriptionName |
| Topic | The name of the topic. Can be either the topic name (e.g., 'my-topic') or the full resource path (e.g., 'projects/my-project/topics/my-topic'). | my-topic |
| Topic Name or Full Format | Select whether the topic input is a full resource path (e.g., 'projects/my-project/topics/my-topic') or just the topic name (e.g., 'my-topic'). | |
| Webhook URL | The URL endpoint to which messages are sent. This is typically the webhook URL of a sibling flow. | https://your-webhook-endpoint.com/webhook/abc123 |
Delete Subscription
Deletes an existing subscription. | key: deleteSubscription
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Subscription | The name of the subscription. Can be either the subscription name (e.g., 'my-subscription') or the full resource path (e.g., 'projects/my-project/subscriptions/my-subscription'). | my-subscription |
| Subscription Name or Full Format | Select whether the subscription input is a full resource path (e.g., 'projects/my-project/subscriptions/my-subscription') or just the subscription name (e.g., 'my-subscription'). |
Delete Topic
Deletes the topic with the given name. | key: deleteTopic
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Topic | The name of the topic. Can be either the topic name (e.g., 'my-topic') or the full resource path (e.g., 'projects/my-project/topics/my-topic'). | my-topic |
| Topic Name or Full Format | Select whether the topic input is a full resource path (e.g., 'projects/my-project/topics/my-topic') or just the topic name (e.g., 'my-topic'). |
{
"data": {}
}
Get Policy
Gets the access control policy for a resource. | key: getPolicy
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Requested Policy Version | The maximum policy version to use for formatting the policy. Valid values are 0, 1, and 3. Policies with conditional bindings must use version 3. | 3 |
| Resource | The resource name for which the policy is being requested. See Resource Names for more information. | projects/my-project/topics/my-topic |
Get Subscription
Gets the configuration details of a subscription. | key: getSubscription
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Subscription | The name of the subscription. Can be either the subscription name (e.g., 'my-subscription') or the full resource path (e.g., 'projects/my-project/subscriptions/my-subscription'). | my-subscription |
| Subscription Name or Full Format | Select whether the subscription input is a full resource path (e.g., 'projects/my-project/subscriptions/my-subscription') or just the subscription name (e.g., 'my-subscription'). |
Get Topic
Gets the configuration of a topic. | key: getTopic
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Topic | The name of the topic. Can be either the topic name (e.g., 'my-topic') or the full resource path (e.g., 'projects/my-project/topics/my-topic'). | my-topic |
| Topic Name or Full Format | Select whether the topic input is a full resource path (e.g., 'projects/my-project/topics/my-topic') or just the topic name (e.g., 'my-topic'). |
List Subscriptions
Lists matching Subscriptions. | key: listSubscriptions
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Fetch All | When true, fetches all pages of results using pagination. | false |
| Page Size | Maximum number of subscriptions to return. | 100 |
| Page Token | The value returned by the last ListSubscriptionsResponse; indicates that this is a continuation of a prior subscriptions.list call, and that the system should return the next page of data. | DBsPVgscdHRpdWhSGwQLQVd- |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
List Topics
Lists matching topics. | key: listTopics
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Fetch All | When true, fetches all pages of results using pagination. | false |
| Page Size | The maximum number of results to return per page. | 100 |
| Page Token | The page token returned by a previous list call to request the next page of results. | DBsPVgscdHRpdWhSGwQLQVd- |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
Pull Messages
Pulls messages from the server. | key: pullMessages
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Max Messages | The maximum number of messages to return. Must be a positive integer. Pub/Sub may return fewer messages than specified. | 100 |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Return Immediately | When true, the system responds immediately even if no messages are available. <strong>Warning:</strong> Setting this to true adversely impacts performance and is discouraged. | false |
| Subscription | The name of the subscription. Can be either the subscription name (e.g., 'my-subscription') or the full resource path (e.g., 'projects/my-project/subscriptions/my-subscription'). | my-subscription |
| Subscription Name or Full Format | Select whether the subscription input is a full resource path (e.g., 'projects/my-project/subscriptions/my-subscription') or just the subscription name (e.g., 'my-subscription'). |
Raw Request
Send raw HTTP request to Google Cloud Pub/Sub | key: rawRequest
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} |
| Debug Request | Enabling this flag will log out the current request. | false |
| File Data | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] |
| File Data File Names | File names to apply to the file data inputs. Keys must match the file data keys above. | |
| Form Data | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] |
| Header | A list of headers to send with the request. | User-Agent: curl/7.64.1 |
| Max Retry Count | The maximum number of retries to attempt. Specify 0 for no retries. | 0 |
| Method | The HTTP method to use. | |
| Query Parameter | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | |
| Response Type | The type of data you expect in the response. You can request json, text, or binary data. | json |
| Retry On All Errors | If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors. | false |
| Retry Delay (ms) | The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled. | 0 |
| Timeout | The maximum time that a client will await a response to its request | 2000 |
| URL | Input the path only (/projects/{projectId}/topics), The base URL is already included (https://pubsub.googleapis.com/{version}). For example, to connect to https://pubsub.googleapis.com/v1/projects/{projectId}/topics, only /projects/{projectId}/topics is entered in this field. | /projects/{projectId}/topics |
| Use Exponential Backoff | Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored. | false |
| API Version | The API version to use for constructing the base URL for requests. | v1 |
Set Gmail IAM Policy for Topic
Configure a topic to allow publish notifications from Gmail. | key: setTopicIamPolicy
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Topic | The full name of the topic to set the IAM policy for | /topics/PROJECT-NAME/topics/TOPIC-NAME |
{
"data": {
"version": 3,
"bindings": [
{
"role": "roles/pubsub.publisher",
"members": [
"serviceAccount:my-service-account@my-project.iam.gserviceaccount.com",
"serviceAccount:gmail-api-push@system.gserviceaccount.com"
]
},
{
"role": "roles/pubsub.subscriber",
"members": [
"serviceAccount:subscriber@my-project.iam.gserviceaccount.com"
]
},
{
"role": "roles/pubsub.viewer",
"members": [
"user:john.doe@example.com",
"group:team@example.com"
],
"condition": {
"title": "Production environment only",
"description": "Allow access only in production",
"expression": "resource.name.startsWith(\"projects/my-gcp-project-123456/\")"
}
}
],
"etag": "BwYFgrUAAAA="
}
}
Set Policy
Sets the access control policy on the specified resource. | key: setPolicy
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Policy | The complete IAM policy to apply to the resource. See Policy for more information. | |
| Resource | The resource name for which the policy is being requested. See Resource Names for more information. | projects/my-project/topics/my-topic |
Update Push Config
This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. | key: updatePushConfig
| Input | Notes | Example |
|---|---|---|
| Attributes | Endpoint configuration attributes for message delivery. The x-goog-version attribute controls the push message format. See Push Delivery for more information. | |
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| OIDC Token | Configuration for generating an OIDC JWT token as an Authorization header for push requests. See Authentication for more information. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Push Endpoint | The URL endpoint to which messages should be pushed. | https://example.com/webhook/pubsub |
| Subscription | The name of the subscription. Can be either the subscription name (e.g., 'my-subscription') or the full resource path (e.g., 'projects/my-project/subscriptions/my-subscription'). | my-subscription |
| Subscription Name or Full Format | Select whether the subscription input is a full resource path (e.g., 'projects/my-project/subscriptions/my-subscription') or just the subscription name (e.g., 'my-subscription'). |
Update Subscription
Updates an existing subscription. | key: updateSubscription
| Input | Notes | Example |
|---|---|---|
| Ack Deadline Seconds | The time (in seconds) Pub/Sub waits for acknowledgment before resending the message. Must be between 10 and 600 seconds. Default is 10 seconds if not specified. | 60 |
| BigQuery Config | Configuration for BigQuery delivery. See BigQueryConfig for more information. | |
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| Dead Letter Policy | Policy for dead lettering undeliverable messages. See Dead Letter Topics for more information. | |
| Detached | When true, the subscription is detached from its topic and will not receive messages or retain backlog. | false |
| Enable Exactly Once Delivery | When true, Pub/Sub guarantees exactly-once delivery semantics for messages on this subscription. | false |
| Enable Message Ordering | When true, messages with the same orderingKey are delivered to subscribers in the order they are received by Pub/Sub. | false |
| Expiration Policy | Policy specifying when the subscription expires. Default TTL is 31 days if not set. See ExpirationPolicy for more information. | |
| Filter | A filter expression to select which messages are delivered. See Filtering Messages for syntax. | attributes.environment = "production" |
| Labels | Labels to organize and group resources. See Creating and Updating Labels for more information. | |
| Message Retention Duration | The minimum duration to retain a message after publication. Must be between 10 minutes (600s) and 31 days (2678400s). Format: duration in seconds with up to nine fractional digits, ending with 's' (e.g., '3600s' for 1 hour). | 86400s |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Push Config | Configuration for push delivery. See PushConfig for more information. | |
| Retain Acked Messages | When true, acknowledged messages are retained in the subscription's backlog until they fall outside the messageRetentionDuration window. Required for seeking to past timestamps. | false |
| Retry Policy | Policy for retrying message delivery. See RetryPolicy for more information. | |
| State | Output-only field indicating whether the subscription can receive messages. | ACTIVE |
| Subscription | The name of the subscription. Can be either the subscription name (e.g., 'my-subscription') or the full resource path (e.g., 'projects/my-project/subscriptions/my-subscription'). | my-subscription |
| Subscription Name or Full Format | Select whether the subscription input is a full resource path (e.g., 'projects/my-project/subscriptions/my-subscription') or just the subscription name (e.g., 'my-subscription'). | |
| Topic | The name of the topic from which this subscription is receiving messages. The value of this field will be deleted-topic if the topic has been deleted. | my-topic |
| Topic Message Retention Duration | Output-only field indicating the minimum duration messages are retained in the topic. Format: duration in seconds ending with 's' (e.g., '86400s'). | 86400s |
| Update Mask | Comma-separated list of field paths to update. See Field Masks for more information. | labels,messageRetentionDuration |
Update Topic
Updates an existing topic. | key: updateTopic
| Input | Notes | Example |
|---|---|---|
| Connection | The connection to use for authenticating requests to Google Cloud Pub/Sub. | |
| KMS Key Name | The resource name of the Cloud KMS CryptoKey used to protect access to messages published on this topic. See Customer-Managed Encryption Keys for more information. | projects/my-project/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key |
| Labels | Labels to organize and group resources. See Creating and Updating Labels for more information. | |
| Message Retention Duration | The minimum duration to retain a message after publication. Must be between 10 minutes (600s) and 31 days (2678400s). Format: duration in seconds with up to nine fractional digits, ending with 's' (e.g., '3600s' for 1 hour). | 86400s |
| Message Storage Policy | Policy constraining the Google Cloud regions where messages may be stored. See Message Storage Policy for more information. | |
| Project ID | The Google Cloud project ID containing the Pub/Sub resources. | my-gcp-project-123456 |
| Satisfies PZS | When true, indicates the topic satisfies physical zone separation. This is an output-only field reserved for future use. | false |
| Schema Settings | Settings for validating messages against a schema. See Schema Settings for more information. | |
| Topic | Name of the topic | my-topic |
| Topic Name or Full Format | Select whether the topic input is a full resource path (e.g., 'projects/my-project/topics/my-topic') or just the topic name (e.g., 'my-topic'). | |
| Update Mask | Comma-separated list of field paths to update. See Field Masks for more information. | labels,messageRetentionDuration |
{
"data": {
"name": "projects/my-gcp-project-123456/topics/order-events",
"labels": {
"environment": "production",
"team": "engineering",
"cost_center": "cc-1234"
},
"messageStoragePolicy": {
"allowedPersistenceRegions": [
"us-east1",
"us-west1"
]
},
"kmsKeyName": "projects/my-gcp-project-123456/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key",
"schemaSettings": {
"schema": "projects/my-gcp-project-123456/schemas/order-schema",
"encoding": "JSON",
"firstRevisionId": "1a2b3c4d",
"lastRevisionId": "5e6f7g8h"
},
"satisfiesPzs": false,
"messageRetentionDuration": "86400s",
"alreadyExisted": false
}
}
Changelog
2025-10-28
Added inline data sources for topics and subscriptions to enhance data selection capabilities