aws-cdk-lib.aws_lambda.LayerVersionProps

interface LayerVersionProps

LanguageType name
.NETAmazon.CDK.AWS.Lambda.LayerVersionProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#LayerVersionProps
Javasoftware.amazon.awscdk.services.lambda.LayerVersionProps
Pythonaws_cdk.aws_lambda.LayerVersionProps
TypeScript (source)aws-cdk-lib » aws_lambda » LayerVersionProps

Example

new lambda.LayerVersion(this, 'MyLayer', {
  removalPolicy: RemovalPolicy.RETAIN,
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
  compatibleArchitectures: [lambda.Architecture.X86_64, lambda.Architecture.ARM_64],
});

Properties

NameTypeDescription
codeCodeThe content of this Layer.
compatibleArchitectures?Architecture[]The system architectures compatible with this layer.
compatibleRuntimes?Runtime[]The runtimes compatible with this Layer.
description?stringThe description the this Lambda Layer.
layerVersionName?stringThe name of the layer.
license?stringThe SPDX licence identifier or URL to the license file for this layer.
removalPolicy?RemovalPolicyWhether to retain this version of the layer when a new version is added or when the stack is deleted.

code

Type: Code

The content of this Layer.

Using Code.fromInline is not supported.


compatibleArchitectures?

Type: Architecture[] (optional, default: [Architecture.X86_64])

The system architectures compatible with this layer.


compatibleRuntimes?

Type: Runtime[] (optional, default: All runtimes are supported.)

The runtimes compatible with this Layer.


description?

Type: string (optional, default: No description.)

The description the this Lambda Layer.


layerVersionName?

Type: string (optional, default: A name will be generated.)

The name of the layer.


license?

Type: string (optional, default: No license information will be recorded.)

The SPDX licence identifier or URL to the license file for this layer.


removalPolicy?

Type: RemovalPolicy (optional, default: RemovalPolicy.DESTROY)

Whether to retain this version of the layer when a new version is added or when the stack is deleted.