Skip to content

GCP.Filestore reference

Source: src/GCP/Filestore/Backup.ts

A Cloud Filestore backup of an instance file share.

Changing backupId, location, sourceInstance, sourceFileShare, or kmsKey replaces the backup. Description and labels update in place.

Backups are regional. Creating a backup of a Basic HDD share typically takes several minutes.

Backup the default share

const nfs = yield* GCP.Filestore.Instance("Nfs", {});
const backup = yield* GCP.Filestore.Backup("Nightly", {
sourceInstance: nfs.name,
});

Explicit id, share, labels, and description

const backup = yield* GCP.Filestore.Backup("Nightly", {
sourceInstance: nfs.name,
sourceFileShare: "share1",
backupId: "app-nfs-nightly",
location: "us-central1",
description: "nightly backup",
labels: { env: "prod" },
});

Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.

const backup = yield* GCP.Filestore.Backup("Nightly", {
sourceInstance: nfs.name,
description: "nightly backup v2",
labels: { env: "prod", team: "storage" },
});

Source: src/GCP/Filestore/GetBackup.ts

Runtime binding for Cloud Filestore backups.get.

Bind this operation to a Backup in a Function/Action init phase. Provide GetBackupHttp.

const getBackup = yield* GCP.Filestore.GetBackup(backup);
const live = yield* getBackup();

Source: src/GCP/Filestore/GetBackupHttp.ts Kind: Layer · Provides: GCP.Filestore.GetBackup

HTTP implementation of GetBackup.

Source: src/GCP/Filestore/GetInstance.ts

Runtime binding for Cloud Filestore instances.get.

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

const getInstance = yield* GCP.Filestore.GetInstance(nfs);
const live = yield* getInstance();

Source: src/GCP/Filestore/GetInstanceHttp.ts Kind: Layer · Provides: GCP.Filestore.GetInstance

HTTP implementation of GetInstance.

Source: src/GCP/Filestore/GetInstancesSnapshot.ts

Runtime binding for Cloud Filestore snapshots.get.

Bind this operation to an InstancesSnapshot in a Function/Action init phase. Provide GetInstancesSnapshotHttp.

const getSnapshot = yield* GCP.Filestore.GetInstancesSnapshot(snap);
const live = yield* getSnapshot();

Source: src/GCP/Filestore/GetInstancesSnapshotHttp.ts Kind: Layer · Provides: GCP.Filestore.GetInstancesSnapshot

HTTP implementation of GetInstancesSnapshot.

Source: src/GCP/Filestore/Instance.ts

A Cloud Filestore instance (NFS file share).

Changing instanceId, location, tier, protocol, kmsKeyName, share name/sourceBackup, or network identity (network, modes, connect mode, reserved range) replaces the instance. Description, labels, share capacity, NFS export options, performance, and deletion protection update in place.

Provisioning a Basic HDD 1 TiB instance typically takes 5-10 minutes.

Generated name, Basic HDD 1 TiB

const nfs = yield* GCP.Filestore.Instance("Nfs", {});

Explicit id, labels, and description

const nfs = yield* GCP.Filestore.Instance("Nfs", {
instanceId: "app-nfs",
location: "us-central1-a",
tier: "BASIC_HDD",
fileShares: [{ name: "share1", capacityGb: 1024 }],
networks: [{ network: "default", modes: ["MODE_IPV4"] }],
description: "app file share",
labels: { env: "prod" },
});
const nfs = yield* GCP.Filestore.Instance("Nfs", {
fileShares: [{
name: "share1",
capacityGb: 1024,
nfsExportOptions: [{
accessMode: "READ_WRITE",
squashMode: "ROOT_SQUASH",
ipRanges: ["10.0.0.0/8"],
}],
}],
});

Source: src/GCP/Filestore/InstancesSnapshot.ts

A Cloud Filestore snapshot of an instance.

Changing snapshotId, instance, or location replaces the snapshot. Description and labels update in place.

Snapshots are supported on Zonal, Regional, Enterprise, and High Scale SSD instances. Basic HDD and Basic SSD reject snapshot create.

Generated name

const snap = yield* GCP.Filestore.InstancesSnapshot("Nightly", {
instance: nfs.name,
});

Explicit id, description, and labels

const snap = yield* GCP.Filestore.InstancesSnapshot("Nightly", {
instance: nfs.name,
snapshotId: "app-nightly",
description: "nightly snapshot",
labels: { env: "prod" },
});

Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.

const snap = yield* GCP.Filestore.InstancesSnapshot("Nightly", {
instance: nfs.name,
description: "nightly snapshot v2",
labels: { env: "prod", team: "storage" },
});