interface VersionProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.VersionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#VersionProps |
Java | software.amazon.awscdk.services.lambda.VersionProps |
Python | aws_cdk.aws_lambda.VersionProps |
TypeScript (source) | aws-cdk-lib » aws_lambda » VersionProps |
Properties for a new Lambda version.
Example
declare const fn: lambda.Function;
const version = new lambda.Version(this, 'MyVersion', {
lambda: fn,
});
Properties
Name | Type | Description |
---|---|---|
lambda | IFunction | Function to get the value of. |
code | string | SHA256 of the version of the Lambda source code. |
description? | string | Description of the version. |
max | Duration | The maximum age of a request that Lambda sends to a function for processing. |
on | IDestination | The destination for failed invocations. |
on | IDestination | The destination for successful invocations. |
provisioned | number | Specifies a provisioned concurrency configuration for a function's version. |
removal | Removal | Whether to retain old versions of this function when a new version is created. |
retry | number | The maximum number of times to retry when the function returns an error. |
lambda
Type:
IFunction
Function to get the value of.
codeSha256?
Type:
string
(optional, default: No validation is performed)
SHA256 of the version of the Lambda source code.
Specify to validate that you're deploying the right version.
description?
Type:
string
(optional, default: Description of the Lambda)
Description of the version.
maxEventAge?
Type:
Duration
(optional, default: Duration.hours(6))
The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds Maximum: 6 hours
onFailure?
Type:
IDestination
(optional, default: no destination)
The destination for failed invocations.
onSuccess?
Type:
IDestination
(optional, default: no destination)
The destination for successful invocations.
provisionedConcurrentExecutions?
Type:
number
(optional, default: No provisioned concurrency)
Specifies a provisioned concurrency configuration for a function's version.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.DESTROY)
Whether to retain old versions of this function when a new version is created.
retryAttempts?
Type:
number
(optional, default: 2)
The maximum number of times to retry when the function returns an error.
Minimum: 0 Maximum: 2