# GCP PubSub

Sends messages to a GCP Cloud Pub/Sub topic. Metadata from messages are sent as attributes.

## Configuration

| Name             | Type       | Optional | Secret | Description                                                                                                                                                                                                                                                                                      |
| ---------------- | ---------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| project          | string     | no       | no     | The Google Cloud project to write to.                                                                                                                                                                                                                                                            |
| credentials_json | string     | no       | no     | JSON credentials for authenticating with GCP.                                                                                                                                                                                                                                                    |
| topic            | expression | no       | no     | The topic to publish to. This field supports interpolation functions.                                                                                                                                                                                                                            |
| endpoint         | string     | yes      | no     | An optional endpoint to override the default of `pubsub.googleapis.com:443`. This can be used to connect to a region specific pubsub endpoint. For a list of valid values, see [this document](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#list_of_regional_endpoints). |
| ordering_key     | expression | yes      | no     | The ordering key to use for publishing messages. This field supports interpolation functions.                                                                                                                                                                                                    |
| publish_timeout  | string     | yes      | no     | The maximum duration to wait for a message to be published before timing out. The value defaults to `1m`.                                                                                                                                                                                        |
| metadata         | metadata   | yes      | no     | Specify criteria for which metadata values are attached to objects as headers.                                                                                                                                                                                                                   |
| max_in_flight    | int        | yes      | no     | The maximum number of messages to have in flight at any given time. The value defaults to `64`.                                                                                                                                                                                                  |

### Metadata

| Name             | Type   | Optional | Secret | Description                                                                                            |
| ---------------- | ------ | -------- | ------ | ------------------------------------------------------------------------------------------------------ |
| exclude_prefixes | string | yes      | no     | Provide a list of explicit metadata key prefixes to be excluded when adding metadata to sent messages. |
