Skip to content

GCP.SaasServiceManagement reference

Source: packages/gcp/src/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" }],
});

Release.lookup references a release 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 release.

const release = GCP.SaasServiceManagement.Release.lookup({
releaseId: "my-release",
});

Source: packages/gcp/src/SaasServiceManagement/Rollout.ts

An App Lifecycle Manager rollout — one execution of a RolloutKind against a Release.

rolloutId, location, rolloutKind, and release 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" },
});

Rollout.lookup references a rollout 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 rollout.

const rollout = GCP.SaasServiceManagement.Rollout.lookup({
rolloutId: "my-rollout",
});

Source: packages/gcp/src/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 },
});

RolloutKind: Looking up an existing rollout kind

Section titled “RolloutKind: Looking up an existing rollout kind”

RolloutKind.lookup references a rollout kind 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 rollout kind.

const rolloutKind = GCP.SaasServiceManagement.RolloutKind.lookup({
rolloutKindId: "my-rollout-kind",
});

Source: packages/gcp/src/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" },
});

Saa.lookup references a saa 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 saa.

const saa = GCP.SaasServiceManagement.Saa.lookup({ saasId: "my-saas" });

Source: packages/gcp/src/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" },
});

Tenant.lookup references a tenant 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 tenant.

const tenant = GCP.SaasServiceManagement.Tenant.lookup({
tenantId: "my-tenant",
});

Source: packages/gcp/src/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" },
});

Unit.lookup references an unit 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 unit.

const unit = GCP.SaasServiceManagement.Unit.lookup({ unitId: "my-unit" });

Source: packages/gcp/src/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" },
});

UnitKind: Looking up an existing unit kind

Section titled “UnitKind: Looking up an existing unit kind”

UnitKind.lookup references an unit kind 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 unit kind.

const unitKind = GCP.SaasServiceManagement.UnitKind.lookup({
unitKindId: "my-unit-kind",
});

Source: packages/gcp/src/SaasServiceManagement/UnitOperation.ts

An App Lifecycle Manager unit operation — one provision, upgrade, or deprovision 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,
});

UnitOperation: Looking up an existing unit operation

Section titled “UnitOperation: Looking up an existing unit operation”

UnitOperation.lookup references an unit operation 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 unit operation.

const unitOperation = GCP.SaasServiceManagement.UnitOperation.lookup({
unitOperationId: "my-unit-operation",
});