Cloud Pub/Sub functions

Cloud Pub/Sub is Google's managed event streaming service. Because serverless architectures tend to be heavily event-driven, triggering Cloud Functions from Pub/Sub is often a very powerful pattern. When creating a Pub/Sub trigger, developers specify the Pub/Sub topic to be used. Cloud Functions will generate a new push subscription for the specified topic in the form of gcf-<FUNCTION_NAME>-<TOPIC_NAME>. Note that the generated subscription will be automatically deleted upon deletion of the function.

Cloud Pub/Sub triggers deliver the following payload as the event body:

{    "eventId": "27819225098479",    "timestamp": "2018-01-27T18:11:24.836Z",    "eventType": "providers/cloud.pubsub/eventTypes/topic.publish", "resource": ...

Get Building Google Cloud Platform Solutions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.