interface LayerVersionProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.LayerVersionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#LayerVersionProps |
Java | software.amazon.awscdk.services.lambda.LayerVersionProps |
Python | aws_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
| Name | Type | Description |
|---|---|---|
| code | Code | The content of this Layer. |
| compatible | Architecture[] | The system architectures compatible with this layer. |
| compatible | Runtime[] | The runtimes compatible with this Layer. |
| description? | string | The description the this Lambda Layer. |
| layer | string | The name of the layer. |
| license? | string | The SPDX licence identifier or URL to the license file for this layer. |
| removal | Removal | Whether 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:
Removal
(optional, default: RemovalPolicy.DESTROY)
Whether to retain this version of the layer when a new version is added or when the stack is deleted.

.NET
Go
Java
Python
TypeScript (