Skip to content
GitHubXDiscordRSS

Version

Learn how to create, update, and manage AWS Lambda Versions using Alchemy Cloud Control.

The Version resource lets you manage AWS Lambda Versions to ensure your functions are versioned and can be easily deployed or rolled back.

Create a basic Lambda version for an existing function with minimal settings:

import AWS from "alchemy/aws/control";
const lambdaVersion = await AWS.Lambda.Version("myLambdaVersion", {
FunctionName: "myLambdaFunction"
});

Configure a Lambda version with additional options such as a description and provisioned concurrency settings:

const advancedLambdaVersion = await AWS.Lambda.Version("myAdvancedLambdaVersion", {
FunctionName: "myLambdaFunction",
Description: "Version 1.0 of my Lambda function with provisioned concurrency.",
ProvisionedConcurrencyConfig: {
ProvisionedConcurrentExecutions: 5
}
});

Create a Lambda version that includes a runtime policy for additional security:

const lambdaVersionWithPolicy = await AWS.Lambda.Version("myLambdaVersionWithPolicy", {
FunctionName: "myLambdaFunction",
RuntimePolicy: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Action: "lambda:InvokeFunction",
Resource: "*"
}
]
}
});

Deploy a Lambda version with a specific code SHA256 for integrity verification:

const lambdaVersionWithCodeSha = await AWS.Lambda.Version("myLambdaVersionWithCodeSha", {
FunctionName: "myLambdaFunction",
CodeSha256: "abc123...xyz"
});