# LayerVersionProps

Extends: LayerVersionProps
Extends: LayerVersionOptions
Used as props by: LayerVersion

- Source: [`aws-lambda/lib/layers.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-lambda/lib/layers.ts#L54)

## 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

- `code`: [Code](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Code.html) (required) — The content of this Layer.

  Using `Code.fromInline` is not supported.

- `compatibleArchitectures`: [Architecture](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Architecture.html)[] = [Architecture.X86_64] — The system architectures compatible with this layer.

- `compatibleRuntimes`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html)[] = All runtimes are supported. — The runtimes compatible with this Layer.

- `description`: string = No description. — The description the this Lambda Layer.

- `layerVersionName`: string = A name will be generated. — The name of the layer.

- `license`: string = No license information will be recorded. — The SPDX licence identifier or URL to the license file for this layer.

  **Default:** No license information will be recorded.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.DESTROY — Whether to retain this version of the layer when a new version is added or when the stack is deleted.
