Skip to content

GCP.Metastore reference

Source: packages/gcp/src/Metastore/Federation.ts

A Dataproc Metastore federation that serves metadata from ranked BigQuery and Dataproc Metastore backends.

Changing federationId, location, or version replaces the federation. Labels and backendMetastores update in place.

BigQuery backend

const federation = yield* GCP.Metastore.Federation("Lakehouse", {
version: "3.1.2",
backendMetastores: {
"1": {
name: "projects/my-project",
metastoreType: "BIGQUERY",
},
},
labels: { env: "prod" },
});

Generated name

const federation = yield* GCP.Metastore.Federation("Lakehouse", {
labels: { env: "test" },
});
// Same logical id, changed props: the engine updates it in place.
const federation = yield* GCP.Metastore.Federation("Lakehouse", {
version: "3.1.2",
backendMetastores: {
"1": {
name: "projects/my-project",
metastoreType: "BIGQUERY",
},
},
labels: { env: "prod", team: "data" },
});

Federation: Looking up an existing federation

Section titled “Federation: Looking up an existing federation”

Federation.lookup references a federation 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 federation.

const federation = GCP.Metastore.Federation.lookup({
federationId: "my-federation",
});

Source: packages/gcp/src/Metastore/Service.ts

A Dataproc Metastore service — a managed Hive metastore.

Changing serviceId, location, Hive version, network, databaseType, encryptionConfig, networkConfig, or releaseChannel replaces the service. Labels, port, tier, scaling, telemetry, scheduled backups, metadata integration, maintenance window, Hive overrides, and deletion protection update in place.

Developer tier

const service = yield* GCP.Metastore.Service("Hive", {
hiveMetastoreConfig: { version: "3.1.2" },
tier: "DEVELOPER",
labels: { env: "test" },
});

Explicit id

const service = yield* GCP.Metastore.Service("Hive", {
serviceId: "analytics-hive",
hiveMetastoreConfig: { version: "3.1.2" },
port: 9083,
});
// Same logical id, changed props: the engine updates it in place.
const service = yield* GCP.Metastore.Service("Hive", {
hiveMetastoreConfig: { version: "3.1.2" },
port: 9084,
labels: { env: "prod" },
});

Service.lookup references a service 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 service.

const service = GCP.Metastore.Service.lookup({ serviceId: "my-service" });

Source: packages/gcp/src/Metastore/ServicesBackup.ts

A Dataproc Metastore service backup — a point-in-time capture of a Hive metastore.

Changing backupId, service, or location replaces the backup. Description is set at create; backups have no update API.

Manual backup

const backup = yield* GCP.Metastore.ServicesBackup("Nightly", {
service: hive.name,
description: "pre-release",
});

Explicit id

const backup = yield* GCP.Metastore.ServicesBackup("Nightly", {
service: hive.name,
backupId: "nightly-01",
});

ServicesBackup: Looking up an existing services backup

Section titled “ServicesBackup: Looking up an existing services backup”

ServicesBackup.lookup references a services 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 services backup.

const servicesBackup = GCP.Metastore.ServicesBackup.lookup({
backupId: "my-backup",
service: "my-service",
});