Skip to content
v2.273.0

LayerVersionProps Struct ​

Example ​

ts
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 ​

codeCodecodeCodecodeCodeCodeCodeCodeCoderequired#
The content of this Layer.

Using Code.fromInline is not supported.

compatibleArchitecturesArchitecture[]compatible_architecturestyping.List[Architecture]compatibleArchitecturesList<Architecture>CompatibleArchitecturesArchitecture[]CompatibleArchitectures*[]Architecture= [Architecture.X86_64]#
The system architectures compatible with this layer.
compatibleRuntimesRuntime[]compatible_runtimestyping.List[Runtime]compatibleRuntimesList<Runtime>CompatibleRuntimesRuntime[]CompatibleRuntimes*[]Runtime= All runtimes are supported.#
The runtimes compatible with this Layer.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description.#
The description the this Lambda Layer.
layerVersionNamestringlayer_version_namestrlayerVersionNameStringLayerVersionNamestringLayerVersionName*string= A name will be generated.#
The name of the layer.
licensestringlicensestrlicenseStringLicensestringLicense*string= No license information will be r…#
The SPDX licence identifier or URL to the license file for this layer.
default

Default: No license information will be recorded.

removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.DESTROY#
Whether to retain this version of the layer when a new version is added or when the stack is deleted.

Used as props by ​