close
AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

LayerVersion

Defines a new Lambda Layer version.

Import

import { LayerVersion } from 'aws-cdk-lib/aws-lambda';

Or use the module namespace:

import * as lambda from 'aws-cdk-lib/aws-lambda';
// lambda.LayerVersion

Properties

Configuration passed to the constructor as LayerVersionProps.

codeRequired
Code

The content of this Layer. Using `Code.fromInline` is not supported.

compatibleArchitecturesOptional
Architecture[]

The system architectures compatible with this layer.

Default: [Architecture.X86_64]

compatibleRuntimesOptional
Runtime[]

The runtimes compatible with this Layer.

Default: - All runtimes are supported.

4 properties inherited from LayerVersionOptions
descriptionOptionalinherited from LayerVersionOptions
string

The description the this Lambda Layer.

Default: - No description.

layerVersionNameOptionalinherited from LayerVersionOptions
string

The name of the layer.

Default: - A name will be generated.

licenseOptionalinherited from LayerVersionOptions
string

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

Default: - No license information will be recorded.

removalPolicyOptionalinherited from LayerVersionOptions
RemovalPolicy

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

Default: RemovalPolicy.DESTROY

Get the AWS Lambda Cheat Sheet

Everything you need to know about AWS Lambda on one page. HD quality, print-friendly.

Download Free Infographic