Skip to content
v2.275.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.

compatibleArchitecturesoptionalArchitecture[]compatible_architecturesoptionaltyping.List[Architecture]compatibleArchitecturesoptionalList<Architecture>CompatibleArchitecturesoptionalArchitecture[]CompatibleArchitecturesoptional*[]Architecture= [Architecture.X86_64]#
The system architectures compatible with this layer.
compatibleRuntimesoptionalRuntime[]compatible_runtimesoptionaltyping.List[Runtime]compatibleRuntimesoptionalList<Runtime>CompatibleRuntimesoptionalRuntime[]CompatibleRuntimesoptional*[]Runtime#
The runtimes compatible with this Layer.

Default: All runtimes are supported.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description the this Lambda Layer.

Default: No description.

layerVersionNameoptionalstringlayer_version_nameoptionalstrlayerVersionNameoptionalStringLayerVersionNameoptionalstringLayerVersionNameoptional*string#
The name of the layer.

Default: A name will be generated.

licenseoptionalstringlicenseoptionalstrlicenseoptionalStringLicenseoptionalstringLicenseoptional*string#
The SPDX licence identifier or URL to the license file for this layer.

Default: No license information will be recorded.

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