Version
Source:
src/AWS/Lambda/Version.ts
An immutable numbered version of a managed Lambda function.
The provider publishes only after the Function’s code and configuration have settled. Re-applying unchanged code and versioned configuration reuses the existing version. Function-level operational changes, such as reserved concurrency, do not publish a new version.
Versions default to retain on removal. Moving or deleting an alias never
deletes an older version, so in-flight durable executions can continue
replaying against the code that started them. Use destroy() only when the
exact numbered version is safe to remove.
Publishing a Version
Section titled “Publishing a Version”const fn = yield* AWS.Lambda.Function("Handler", { main: import.meta.resolve("./handler.ts"),});const version = yield* AWS.Lambda.Version("HandlerVersion", { function: fn,});Promoting with an Alias
Section titled “Promoting with an Alias”const version = yield* AWS.Lambda.Version("CampaignRunVersion", { function: campaign.function,});const live = yield* AWS.Lambda.Alias("CampaignRunLive", { version, aliasName: "live",});Explicit Deletion
Section titled “Explicit Deletion”import { destroy } from "alchemy/RemovalPolicy";
const disposable = yield* AWS.Lambda.Version("PreviewVersion", { function: fn,}).pipe(destroy());