Skip to content
v2.277.0

LayerVersionOptions Struct ​

Non runtime options.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';
const layerVersionOptions: lambda.LayerVersionOptions = {
  description: 'description',
  layerVersionName: 'layerVersionName',
  license: 'license',
  removalPolicy: cdk.RemovalPolicy.DESTROY,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_lambda as lambda_

layer_version_options = lambda.LayerVersionOptions(
    description="description",
    layer_version_name="layerVersionName",
    license="license",
    removal_policy=cdk.RemovalPolicy.DESTROY
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.lambda.*;

LayerVersionOptions layerVersionOptions = LayerVersionOptions.builder()
        .description("description")
        .layerVersionName("layerVersionName")
        .license("license")
        .removalPolicy(RemovalPolicy.DESTROY)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.Lambda;

var layerVersionOptions = new LayerVersionOptions {
    Description = "description",
    LayerVersionName = "layerVersionName",
    License = "license",
    RemovalPolicy = RemovalPolicy.DESTROY
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

layerVersionOptions := &LayerVersionOptions{
	Description: jsii.String("description"),
	LayerVersionName: jsii.String("layerVersionName"),
	License: jsii.String("license"),
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
}

Properties ​

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.