Tag the current state of a Function with a Version number. Avoid using this resource directly. If you need a Version object, use `function.currentVersion` instead. That will add a Version object to your template, and make sure the Version is invalidated whenever the Function object changes. If you use the `Version` resource directly, you are responsible for making sure it is invalidated (by changing its logical ID) whenever necessary. Version resources can then be used in `Alias` resources to refer to a particular deployment of a Lambda. If you want to ensure that you're associating the right version with the right deployment, specify the `codeSha256` property while creating the `Version.
import { Version } from 'aws-cdk-lib/aws-lambda';Or use the module namespace:
import * as lambda from 'aws-cdk-lib/aws-lambda';
// lambda.VersionConfiguration passed to the constructor as VersionProps.
lambdaRequiredIFunctionFunction to get the value of.
VersionOptionscodeSha256Optionalinherited from VersionOptionsstringSHA256 of the version of the Lambda source code. Specify to validate that you're deploying the right version.
Default: No validation is performed
descriptionOptionalinherited from VersionOptionsstringDescription of the version.
Default: Description of the Lambda
maxExecutionEnvironmentsOptionalinherited from VersionOptionsnumberThe maximum number of execution environments allowed for this version when published into a capacity provider. This setting limits the total number of execution environments that can be created to handle concurrent invocations of this specific version.
Default: - No maximum specified
minExecutionEnvironmentsOptionalinherited from VersionOptionsnumberThe minimum number of execution environments to maintain for this version when published into a capacity provider. This setting ensures that at least this many execution environments are always available to handle function invocations for this specific version, reducing cold start latency.
Default: - 3 execution environments are set to be the minimum
provisionedConcurrentExecutionsOptionalinherited from VersionOptionsnumberSpecifies a provisioned concurrency configuration for a function's version.
Default: No provisioned concurrency
removalPolicyOptionalinherited from VersionOptionsRemovalPolicyWhether to retain old versions of this function when a new version is created.
Default: RemovalPolicy.DESTROY
EventInvokeConfigOptionsmaxEventAgeOptionalinherited from EventInvokeConfigOptionsDurationThe maximum age of a request that Lambda sends to a function for processing. Minimum: 60 seconds Maximum: 6 hours
Default: Duration.hours(6)
onFailureOptionalinherited from EventInvokeConfigOptionsIDestinationThe destination for failed invocations.
Default: - no destination
onSuccessOptionalinherited from EventInvokeConfigOptionsIDestinationThe destination for successful invocations.
Default: - no destination
retryAttemptsOptionalinherited from EventInvokeConfigOptionsnumberThe maximum number of times to retry when the function returns an error. Minimum: 0 Maximum: 2
Default: 2
Everything you need to know about AWS Lambda on one page. HD quality, print-friendly.
Download Free Infographicaws-lambda