Skip to content

GCP.Bigtable reference

Source: packages/gcp/src/Bigtable/AppProfile.ts

A Cloud Bigtable app profile — how client traffic is routed across clusters in an instance.

The parent instance must already exist. Every instance has a built-in default profile; this resource creates additional profiles. Changing appProfileId or instance replaces the profile. Description, routing, and isolation update in place.

App profiles have no labels field. Alchemy treats a profile as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it. The built-in default profile is never listed.

Multi-cluster routing

const instance = yield* GCP.Bigtable.Instance("Data", {});
const profile = yield* GCP.Bigtable.AppProfile("Analytics", {
instance: instance.name,
description: "analytics reads",
multiClusterRouting: {},
});

Single-cluster routing

const profile = yield* GCP.Bigtable.AppProfile("Writes", {
instance: instance.name,
singleClusterRouting: {
clusterId: "cluster",
allowTransactionalWrites: true,
},
});

AppProfile: Looking up an existing app profile

Section titled “AppProfile: Looking up an existing app profile”

AppProfile.lookup references an app profile Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared app profile.

const appProfile = GCP.Bigtable.AppProfile.lookup({
appProfileId: "my-app-profile",
instance: "my-instance",
});

Source: packages/gcp/src/Bigtable/Cluster.ts

A Cloud Bigtable cluster — a resizable group of nodes in one zone that serves every table in the parent instance.

An instance always has at least one cluster (created with the instance). Use this resource to add additional clusters or to manage an existing cluster’s node count and autoscaling. You cannot delete the last cluster in an instance.

Changing clusterId, instance, location, defaultStorageType, nodeScalingFactor, or encryptionConfig.kmsKeyName replaces the cluster. serveNodes and clusterConfig.clusterAutoscalingConfig update in place.

Clusters have no labels field. list enumerates clusters on alchemy-labeled instances so pnpm nuke:gcp can find leaked rows.

Provisioning typically takes several minutes.

Additional cluster on an existing instance

const replica = yield* GCP.Bigtable.Cluster("Replica", {
instance: instance.instanceId,
location: "us-central1-b",
serveNodes: 1,
});

Explicit id and HDD storage

const replica = yield* GCP.Bigtable.Cluster("Replica", {
instance: "app-instance",
clusterId: "app-replica",
location: "us-central1-c",
defaultStorageType: "HDD",
serveNodes: 1,
});
const replica = yield* GCP.Bigtable.Cluster("Replica", {
instance: "app-instance",
location: "us-central1-f",
clusterConfig: {
clusterAutoscalingConfig: {
autoscalingLimits: { minServeNodes: 1, maxServeNodes: 3 },
autoscalingTargets: { cpuUtilizationPercent: 50 },
},
},
});

Cluster.lookup references a cluster Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared cluster.

const cluster = GCP.Bigtable.Cluster.lookup({
clusterId: "my-cluster",
instance: "my-instance",
});

Source: packages/gcp/src/Bigtable/GetCluster.ts

Runtime binding for Cloud Bigtable clusters.get.

Bind this operation to a Cluster in a Function/Action init phase. Provide GetClusterHttp.

const getCluster = yield* GCP.Bigtable.GetCluster(replica);
const live = yield* getCluster();

Source: packages/gcp/src/Bigtable/GetClusterHttp.ts Kind: Layer · Provides: GCP.Bigtable.GetCluster

HTTP implementation of GetCluster.

Source: packages/gcp/src/Bigtable/GetInstance.ts

Runtime binding for Cloud Bigtable instances.get.

Bind this operation to an Instance in a Function/Action init phase. Provide GetInstanceHttp.

const getInstance = yield* GCP.Bigtable.GetInstance(store);
const live = yield* getInstance();

Source: packages/gcp/src/Bigtable/GetInstanceHttp.ts Kind: Layer · Provides: GCP.Bigtable.GetInstance

HTTP implementation of GetInstance.

Source: packages/gcp/src/Bigtable/GetTable.ts

Runtime binding for Bigtable Admin tables.get.

Bind this operation to a Table in a Function/Action init phase. Provide GetTableHttp.

const getTable = yield* GCP.Bigtable.GetTable(users);
const live = yield* getTable({ view: "SCHEMA_VIEW" });

Source: packages/gcp/src/Bigtable/GetTableHttp.ts Kind: Layer · Provides: GCP.Bigtable.GetTable

HTTP implementation of GetTable.

Source: packages/gcp/src/Bigtable/Instance.ts

A Cloud Bigtable instance — a container for clusters, tables, and app profiles.

Create requires at least one cluster. The default is a single 1-node HDD cluster in us-central1-b. Changing instanceId replaces the instance. displayName, type, edition, and labels update in place. Cluster create-time fields (location, storage type, CMEK) are immutable; manage clusters after create with GCP.Bigtable.Cluster.

Provisioning typically takes one to two minutes.

Generated name, 1-node HDD cluster

const instance = yield* GCP.Bigtable.Instance("Data", {});

Explicit id, labels, and cluster

const instance = yield* GCP.Bigtable.Instance("Data", {
instanceId: "app-bt",
displayName: "app bigtable",
type: "PRODUCTION",
labels: { env: "prod" },
clusters: {
cluster: {
location: "us-central1-b",
serveNodes: 1,
defaultStorageType: "HDD",
},
},
});
const getInstance = yield* GCP.Bigtable.GetInstance(instance);
const live = yield* getInstance();

Instance.lookup references an instance Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared instance.

const instance = GCP.Bigtable.Instance.lookup({ instanceId: "my-instance" });

Source: packages/gcp/src/Bigtable/InstancesClustersBackup.ts

A Cloud Bigtable backup of a table, stored on one cluster.

The parent instance, cluster, and source table must already exist. Changing backupId, instance, cluster, sourceTable, or backupType replaces the backup. expireTime and hotToStandardTime update in place.

Backups have no labels field. Alchemy treats a backup as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesClustersBackup: Creating a Backup

Section titled “InstancesClustersBackup: Creating a Backup”

7-day backup of an existing table

const backup = yield* GCP.Bigtable.InstancesClustersBackup("Nightly", {
instance: instance.name,
cluster: "cluster",
sourceTable: table.name,
});

Explicit id and expiration

const backup = yield* GCP.Bigtable.InstancesClustersBackup("Nightly", {
instance: instance.name,
cluster: replica.clusterId,
sourceTable: table.name,
backupId: "nightly",
expireTime: "2026-12-31T00:00:00Z",
backupType: "STANDARD",
});

InstancesClustersBackup: Looking up an existing instances clusters backup

Section titled “InstancesClustersBackup: Looking up an existing instances clusters backup”

InstancesClustersBackup.lookup references an instances clusters backup Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared instances clusters backup.

const instancesClustersBackup = GCP.Bigtable.InstancesClustersBackup.lookup({
backupId: "my-backup",
instance: "my-instance",
cluster: "my-cluster",
});

Source: packages/gcp/src/Bigtable/InstancesLogicalView.ts

A Cloud Bigtable logical view — a SQL SELECT over a table that can be queried as a virtual table.

The parent instance must already exist and the query cannot use SELECT *. Changing logicalViewId or instance replaces the view. query and deletionProtection update in place.

Logical views have no labels field. Alchemy treats a view as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesLogicalView: Creating a Logical View

Section titled “InstancesLogicalView: Creating a Logical View”
const users = yield* GCP.Bigtable.Table("Users", {
instance: instance.name,
columnFamilies: { cf: {} },
});
const view = yield* GCP.Bigtable.InstancesLogicalView("Active", {
instance: instance.name,
query: "SELECT _key FROM users",
});

InstancesLogicalView: Looking up an existing instances logical view

Section titled “InstancesLogicalView: Looking up an existing instances logical view”

InstancesLogicalView.lookup references an instances logical view Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared instances logical view.

const instancesLogicalView = GCP.Bigtable.InstancesLogicalView.lookup({
logicalViewId: "my-logical-view",
instance: "my-instance",
});

Source: packages/gcp/src/Bigtable/InstancesMaterializedView.ts

A Cloud Bigtable continuous materialized view — a SQL SELECT whose results are precomputed and kept current.

The parent instance must already exist. The query must use GROUP BY or ORDER BY and cannot use SELECT *. Changing materializedViewId, instance, or query replaces the view. deletionProtection updates in place.

Materialized views have no labels field. Alchemy treats a view as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesMaterializedView: Creating a Materialized View

Section titled “InstancesMaterializedView: Creating a Materialized View”
const events = yield* GCP.Bigtable.Table("Events", {
instance: instance.name,
columnFamilies: { cf: {} },
});
const view = yield* GCP.Bigtable.InstancesMaterializedView("Counts", {
instance: instance.name,
query: "SELECT '*' AS _key, COUNT(*) AS row_count FROM events GROUP BY _key",
});

InstancesMaterializedView: Looking up an existing instances materialized view

Section titled “InstancesMaterializedView: Looking up an existing instances materialized view”

InstancesMaterializedView.lookup references an instances materialized view Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared instances materialized view.

const instancesMaterializedView = GCP.Bigtable.InstancesMaterializedView.lookup({
materializedViewId: "my-materialized-view",
instance: "my-instance",
});

Source: packages/gcp/src/Bigtable/InstancesTablesAuthorizedView.ts

A Cloud Bigtable authorized view — a named subset of a table used for fine-grained IAM.

The parent instance and table must already exist. Changing authorizedViewId, instance, or table replaces the view. subsetView and deletionProtection update in place.

Authorized views have no labels field. Alchemy treats a view as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesTablesAuthorizedView: Creating an Authorized View

Section titled “InstancesTablesAuthorizedView: Creating an Authorized View”
const view = yield* GCP.Bigtable.InstancesTablesAuthorizedView("Public", {
instance: instance.name,
table: table.name,
subsetView: {
rowPrefixes: [""],
familySubsets: {
cf: { qualifierPrefixes: [""] },
},
},
});

InstancesTablesAuthorizedView: Looking up an existing instances tables authorized view

Section titled “InstancesTablesAuthorizedView: Looking up an existing instances tables authorized view”

InstancesTablesAuthorizedView.lookup references an instances tables authorized view Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared instances tables authorized view.

const instancesTablesAuthorizedView = GCP.Bigtable.InstancesTablesAuthorizedView.lookup({
authorizedViewId: "my-authorized-view",
instance: "my-instance",
table: "my-table",
});

Source: packages/gcp/src/Bigtable/InstancesTablesSchemaBundle.ts

A Cloud Bigtable schema bundle — a named FileDescriptorSet used to decode protobuf cell values.

The parent instance and table must already exist. Changing schemaBundleId, instance, or table replaces the bundle. protoDescriptors update in place (must be backwards compatible unless ignoreWarnings is true).

Schema bundles have no labels field. Alchemy treats a bundle as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesTablesSchemaBundle: Creating a Schema Bundle

Section titled “InstancesTablesSchemaBundle: Creating a Schema Bundle”
const bundle = yield* GCP.Bigtable.InstancesTablesSchemaBundle("Rows", {
instance: instance.name,
table: table.name,
protoDescriptors: descriptors,
});

InstancesTablesSchemaBundle: Looking up an existing instances tables schema bundle

Section titled “InstancesTablesSchemaBundle: Looking up an existing instances tables schema bundle”

InstancesTablesSchemaBundle.lookup references an instances tables schema bundle Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared instances tables schema bundle.

const instancesTablesSchemaBundle = GCP.Bigtable.InstancesTablesSchemaBundle.lookup({
schemaBundleId: "my-schema-bundle",
instance: "my-instance",
table: "my-table",
});

Source: packages/gcp/src/Bigtable/Table.ts

A Cloud Bigtable table — rows keyed by row key, grouped into column families.

The parent instance must already exist. Changing tableId, instance, or granularity replaces the table. Column families, deletion protection, change streams, and automated backups update in place. Row read/write is a data-plane API; use GetTable for admin metadata.

Tables have no labels field. Alchemy treats a table as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

const instance = yield* GCP.Bigtable.Instance("Data", {});
const table = yield* GCP.Bigtable.Table("Users", {
instance: instance.name,
columnFamilies: {
cf: { gcRule: { maxNumVersions: 3 } },
},
});
const getTable = yield* GCP.Bigtable.GetTable(table);
const live = yield* getTable({ view: "SCHEMA_VIEW" });

Table.lookup references a table Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared table.

const table = GCP.Bigtable.Table.lookup({
tableId: "my-table",
instance: "my-instance",
});