GCP.PubSubLite reference
AdminReservation
Section titled “AdminReservation”Source:
src/GCP/PubSubLite/AdminReservation.ts
A Pub/Sub Lite throughput reservation — a regional pool of publish and subscribe capacity that topics can consume.
Pub/Sub Lite reservations have no labels. Alchemy stamps
alchemy-stack / alchemy-stage / alchemy-id into the reservation
id so list / pnpm nuke:gcp can find them. reservationId and
location replace the reservation; throughputCapacity updates in
place.
AdminReservation: Creating a Reservation
Section titled “AdminReservation: Creating a Reservation”Generated name
const reservation = yield* GCP.PubSubLite.AdminReservation("Capacity", { throughputCapacity: "4",});Explicit id and region
const reservation = yield* GCP.PubSubLite.AdminReservation("Capacity", { reservationId: "analytics", location: "us-central1", throughputCapacity: "8",});AdminReservation: Updating a Reservation
Section titled “AdminReservation: Updating a Reservation”Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.
const reservation = yield* GCP.PubSubLite.AdminReservation("Capacity", { location: "us-central1", throughputCapacity: "16",});AdminSubscription
Section titled “AdminSubscription”Source:
src/GCP/PubSubLite/AdminSubscription.ts
A Pub/Sub Lite subscription — a named consumer of a Lite topic.
Pub/Sub Lite subscriptions have no labels. Alchemy stamps
alchemy-stack / alchemy-stage / alchemy-id into the
subscription id so list / pnpm nuke:gcp can find them.
subscriptionId, location, and topic replace the subscription.
Delivery and export settings update in place. skipBacklog is
create-only.
AdminSubscription: Creating a Subscription
Section titled “AdminSubscription: Creating a Subscription”Pull subscription on a topic
const topic = yield* GCP.PubSubLite.AdminTopic("Events", {});const subscription = yield* GCP.PubSubLite.AdminSubscription("Inbox", { topic: topic.name,});Deliver after stored
const subscription = yield* GCP.PubSubLite.AdminSubscription("Inbox", { topic: topic.name, deliveryConfig: { deliveryRequirement: "DELIVER_AFTER_STORED" },});AdminSubscription: Exporting to Pub/Sub
Section titled “AdminSubscription: Exporting to Pub/Sub”const lite = yield* GCP.PubSubLite.AdminTopic("Events", {});const classic = yield* GCP.PubSub.Topic("Mirror", {});const exported = yield* GCP.PubSubLite.AdminSubscription("Export", { topic: lite.name, exportConfig: { desiredState: "ACTIVE", pubsubConfig: { topic: classic.name }, },});AdminTopic
Section titled “AdminTopic”Source:
src/GCP/PubSubLite/AdminTopic.ts
A Pub/Sub Lite topic — a zonal or regional partitioned log.
Pub/Sub Lite topics have no labels. Alchemy stamps
alchemy-stack / alchemy-stage / alchemy-id into the topic id so
list / pnpm nuke:gcp can find them. topicId and location
replace the topic. Partition count can only increase in place;
shrinking it replaces the topic. Capacity, retention, and reservation
attachment update in place.
AdminTopic: Creating a Topic
Section titled “AdminTopic: Creating a Topic”Zonal topic with generated name
const topic = yield* GCP.PubSubLite.AdminTopic("Events", {});Explicit capacity and retention
const topic = yield* GCP.PubSubLite.AdminTopic("Events", { location: "us-central1-a", partitionConfig: { count: 1, capacity: { publishMibPerSec: 4, subscribeMibPerSec: 8 }, }, retentionConfig: { perPartitionBytes: "32212254720", period: "86400s" },});AdminTopic: Using a Reservation
Section titled “AdminTopic: Using a Reservation”const reservation = yield* GCP.PubSubLite.AdminReservation("Capacity", { location: "us-central1", throughputCapacity: "4",});const topic = yield* GCP.PubSubLite.AdminTopic("Events", { location: "us-central1", reservationConfig: { throughputReservation: reservation.name },});CommitCursor
Section titled “CommitCursor”Source:
src/GCP/PubSubLite/CommitCursor.ts
Runtime binding for Pub/Sub Lite cursor.commitCursor.
Bind this operation to an AdminSubscription in a Function/Action
init phase. Provide CommitCursorHttp.
Grants roles/pubsublite.subscriber on the project: Pub/Sub Lite has no
resource-level IAM.
CommitCursor: Committing a Cursor
Section titled “CommitCursor: Committing a Cursor”const commit = yield* GCP.PubSubLite.CommitCursor(inbox);yield* commit({ body: { partition: "0", cursor: { offset: "10" } },});CommitCursorHttp
Section titled “CommitCursorHttp”Source:
src/GCP/PubSubLite/CommitCursorHttp.tsKind: Layer · Provides:GCP.PubSubLite.CommitCursor
HTTP implementation of CommitCursor.
ComputeHeadCursor
Section titled “ComputeHeadCursor”Source:
src/GCP/PubSubLite/ComputeHeadCursor.ts
Runtime binding for Pub/Sub Lite topicStats.computeHeadCursor.
Bind this operation to an AdminTopic in a Function/Action init
phase. Provide ComputeHeadCursorHttp.
Grants roles/pubsublite.subscriber on the project: Pub/Sub Lite has no
resource-level IAM.
ComputeHeadCursor: Computing the Head Cursor
Section titled “ComputeHeadCursor: Computing the Head Cursor”const computeHead = yield* GCP.PubSubLite.ComputeHeadCursor(events);const { headCursor } = yield* computeHead({ body: { partition: "0" },});ComputeHeadCursorHttp
Section titled “ComputeHeadCursorHttp”Source:
src/GCP/PubSubLite/ComputeHeadCursorHttp.tsKind: Layer · Provides:GCP.PubSubLite.ComputeHeadCursor
HTTP implementation of ComputeHeadCursor.
GetPartitions
Section titled “GetPartitions”Source:
src/GCP/PubSubLite/GetPartitions.ts
Runtime binding for Pub/Sub Lite topics.getPartitions.
Bind this operation to an AdminTopic in a Function/Action init
phase. Provide GetPartitionsHttp.
Grants roles/pubsublite.viewer on the project: Pub/Sub Lite has no
resource-level IAM.
GetPartitions: Reading Partition Count
Section titled “GetPartitions: Reading Partition Count”const getPartitions = yield* GCP.PubSubLite.GetPartitions(events);const { partitionCount } = yield* getPartitions();GetPartitionsHttp
Section titled “GetPartitionsHttp”Source:
src/GCP/PubSubLite/GetPartitionsHttp.tsKind: Layer · Provides:GCP.PubSubLite.GetPartitions
HTTP implementation of GetPartitions.
GetReservation
Section titled “GetReservation”Source:
src/GCP/PubSubLite/GetReservation.ts
Runtime binding for Pub/Sub Lite reservations.get.
Bind this operation to an AdminReservation in a Function/Action
init phase. Provide GetReservationHttp.
Grants roles/pubsublite.viewer on the project: Pub/Sub Lite has no
resource-level IAM.
GetReservation: Observing Reservations
Section titled “GetReservation: Observing Reservations”const getReservation = yield* GCP.PubSubLite.GetReservation(capacity);const live = yield* getReservation();GetReservationHttp
Section titled “GetReservationHttp”Source:
src/GCP/PubSubLite/GetReservationHttp.tsKind: Layer · Provides:GCP.PubSubLite.GetReservation
HTTP implementation of GetReservation.
GetSubscription
Section titled “GetSubscription”Source:
src/GCP/PubSubLite/GetSubscription.ts
Runtime binding for Pub/Sub Lite subscriptions.get.
Bind this operation to an AdminSubscription in a Function/Action
init phase. Provide GetSubscriptionHttp.
Grants roles/pubsublite.viewer on the project: Pub/Sub Lite has no
resource-level IAM.
GetSubscription: Observing Subscriptions
Section titled “GetSubscription: Observing Subscriptions”const getSubscription = yield* GCP.PubSubLite.GetSubscription(inbox);const live = yield* getSubscription();GetSubscriptionHttp
Section titled “GetSubscriptionHttp”Source:
src/GCP/PubSubLite/GetSubscriptionHttp.tsKind: Layer · Provides:GCP.PubSubLite.GetSubscription
HTTP implementation of GetSubscription.
GetTopic
Section titled “GetTopic”Source:
src/GCP/PubSubLite/GetTopic.ts
Runtime binding for Pub/Sub Lite topics.get.
Bind this operation to an AdminTopic in a Function/Action init
phase. Provide GetTopicHttp.
Grants roles/pubsublite.viewer on the project: Pub/Sub Lite has no
resource-level IAM.
GetTopic: Observing Topics
Section titled “GetTopic: Observing Topics”const getTopic = yield* GCP.PubSubLite.GetTopic(events);const live = yield* getTopic();GetTopicHttp
Section titled “GetTopicHttp”Source:
src/GCP/PubSubLite/GetTopicHttp.tsKind: Layer · Provides:GCP.PubSubLite.GetTopic
HTTP implementation of GetTopic.