LayerVersionProps

class aws_cdk.aws_lambda.LayerVersionProps(*, description=None, layer_version_name=None, license=None, removal_policy=None, code, compatible_architectures=None, compatible_runtimes=None)

Bases: LayerVersionOptions

Parameters:
  • description (Optional[str]) – The description the this Lambda Layer. Default: - No description.

  • layer_version_name (Optional[str]) – The name of the layer. Default: - A name will be generated.

  • license (Optional[str]) – The SPDX licence identifier or URL to the license file for this layer. Default: - No license information will be recorded.

  • removal_policy (Optional[RemovalPolicy]) – Whether to retain this version of the layer when a new version is added or when the stack is deleted. Default: RemovalPolicy.DESTROY

  • code (Code) – The content of this Layer. Using Code.fromInline is not supported.

  • compatible_architectures (Optional[Sequence[Architecture]]) – The system architectures compatible with this layer. Default: [Architecture.X86_64]

  • compatible_runtimes (Optional[Sequence[Runtime]]) – The runtimes compatible with this Layer. Default: - All runtimes are supported.

ExampleMetadata:

infused

Example:

lambda_.LayerVersion(self, "MyLayer",
    removal_policy=RemovalPolicy.RETAIN,
    code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler")),
    compatible_architectures=[lambda_.Architecture.X86_64, lambda_.Architecture.ARM_64]
)

Attributes

code

The content of this Layer.

Using Code.fromInline is not supported.

compatible_architectures

The system architectures compatible with this layer.

Default:

[Architecture.X86_64]

compatible_runtimes

The runtimes compatible with this Layer.

Default:
  • All runtimes are supported.

description

The description the this Lambda Layer.

Default:
  • No description.

layer_version_name

The name of the layer.

Default:
  • A name will be generated.

license

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

Default:
  • No license information will be recorded.

removal_policy

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

Default:

RemovalPolicy.DESTROY