Skip to content

GCP.SaasServiceManagement reference

Source: src/GCP/SaasServiceManagement/Release.ts

An App Lifecycle Manager release — a version of a UnitKind packaged as an OCI blueprint.

releaseId, location, unitKind, and blueprint.package replace the release. Input variable defaults, upgrade constraints, labels, and annotations update in place.

const release = yield* GCP.SaasServiceManagement.Release("V1", {
unitKind: kind.name,
blueprint: { package: "us-central1-docker.pkg.dev/proj/blueprints/store:v1" },
labels: { env: "prod" },
});
const release = yield* GCP.SaasServiceManagement.Release("V1", {
releaseId: release.releaseId,
unitKind: kind.name,
blueprint: { package: "us-central1-docker.pkg.dev/proj/blueprints/store:v1" },
inputVariableDefaults: [{ variable: "region", type: "STRING", value: "us-central1" }],
});

Source: src/GCP/SaasServiceManagement/Rollout.ts

An App Lifecycle Manager rollout — one execution of a RolloutKind against a Release (or FlagRelease).

rolloutId, location, rolloutKind, release, and flagRelease replace the rollout. Unit filter, strategy override, control action, labels, and annotations update in place. Requests to pause or cancel are only accepted while the rollout is non-terminal.

const rollout = yield* GCP.SaasServiceManagement.Rollout("Wave1", {
rolloutKind: kind.name,
release: release.name,
labels: { env: "prod" },
});
const rollout = yield* GCP.SaasServiceManagement.Rollout("Wave1", {
rolloutId: rollout.rolloutId,
rolloutKind: kind.name,
release: release.name,
control: { action: "ROLLOUT_ACTION_PAUSE" },
});

Source: src/GCP/SaasServiceManagement/RolloutKind.ts

An App Lifecycle Manager rollout kind — the policy a Rollout follows when upgrading units of a UnitKind.

rolloutKindId, location, and unitKind replace the rollout kind. Strategy, error budget, unit filter, pacing, labels, and annotations update in place.

const kind = yield* GCP.SaasServiceManagement.RolloutKind("Wave", {
unitKind: storeKind.name,
rolloutOrchestrationStrategy: "Google.Cloud.Simple.AllAtOnce",
labels: { env: "prod" },
});
const kind = yield* GCP.SaasServiceManagement.RolloutKind("Wave", {
rolloutKindId: kind.rolloutKindId,
unitKind: storeKind.name,
errorBudget: { allowedCount: 1, allowedPercentage: 5 },
});

Source: src/GCP/SaasServiceManagement/Saa.ts

An App Lifecycle Manager SaaS product definition.

A SaaS is the producer-side product that Tenants, UnitKinds, and Units hang off. saasId and location replace the resource. locations, labels, and annotations update in place.

Generated name

const product = yield* GCP.SaasServiceManagement.Saa("Inventory", {
locations: [{ name: "us-central1" }],
});

Named SaaS with labels

const product = yield* GCP.SaasServiceManagement.Saa("Inventory", {
saasId: "inventory",
locations: [{ name: "us-central1" }, { name: "europe-west1" }],
labels: { env: "prod" },
});
const product = yield* GCP.SaasServiceManagement.Saa("Inventory", {
saasId: "inventory",
locations: [{ name: "us-central1" }, { name: "us-east1" }],
labels: { env: "prod", role: "saas" },
});

Source: src/GCP/SaasServiceManagement/Tenant.ts

An App Lifecycle Manager tenant — the producer-side instance of a SaaS created for one consumer.

tenantId, location, saas, and consumerResource replace the tenant. Labels and annotations update in place.

const product = yield* GCP.SaasServiceManagement.Saa("Inventory", {
locations: [{ name: "us-central1" }],
});
const tenant = yield* GCP.SaasServiceManagement.Tenant("Acme", {
saas: product.name,
labels: { env: "prod" },
});
const tenant = yield* GCP.SaasServiceManagement.Tenant("Acme", {
tenantId: "acme",
saas: product.name,
labels: { env: "prod", customer: "acme" },
});

Source: src/GCP/SaasServiceManagement/Unit.ts

An App Lifecycle Manager unit — one deployable instance of a UnitKind.

A unit is actuated by a blueprint engine (Terraform, Helm, …) under the hood. unitId, location, unitKind, tenant, and managementMode replace the unit. Maintenance pins, labels, and annotations update in place.

const unit = yield* GCP.SaasServiceManagement.Unit("Store1", {
unitKind: kind.name,
tenant: tenant.name,
managementMode: "MANAGEMENT_MODE_USER",
labels: { env: "prod" },
});
const unit = yield* GCP.SaasServiceManagement.Unit("Store1", {
unitId: unit.unitId,
unitKind: kind.name,
maintenance: { pinnedUntilTime: "2030-01-01T00:00:00Z" },
});

Source: src/GCP/SaasServiceManagement/UnitKind.ts

An App Lifecycle Manager unit kind — the blueprint family that Units of a SaaS share.

Units of the same kind follow the same release model and are typically rolled out together. unitKindId, location, saas, and dependencies replace the unit kind. Default release, mappings, labels, and annotations update in place.

const product = yield* GCP.SaasServiceManagement.Saa("Inventory", {
locations: [{ name: "us-central1" }],
});
const kind = yield* GCP.SaasServiceManagement.UnitKind("Store", {
saas: product.name,
labels: { env: "prod" },
});
const kind = yield* GCP.SaasServiceManagement.UnitKind("Store", {
unitKindId: kind.unitKindId,
saas: product.name,
defaultRelease: release.name,
labels: { env: "prod" },
});

Source: src/GCP/SaasServiceManagement/UnitOperation.ts

An App Lifecycle Manager unit operation — one provision, upgrade, deprovision, or flag-update of a Unit.

unitOperationId, location, unit, and the chosen operation type replace the resource. cancel, labels, and annotations update in place. Only one mutating unit operation runs on a unit at a time.

Provision a unit

const op = yield* GCP.SaasServiceManagement.UnitOperation("Provision", {
unit: unit.name,
provision: { release: release.name },
labels: { env: "prod" },
});

Deprovision

const op = yield* GCP.SaasServiceManagement.UnitOperation("Teardown", {
unit: unit.name,
deprovision: true,
});
const op = yield* GCP.SaasServiceManagement.UnitOperation("Provision", {
unitOperationId: op.unitOperationId,
unit: unit.name,
provision: { release: release.name },
cancel: true,
});