Skip to content
v2.276.0

LayerVersionAttributes Struct ​

Properties necessary to import a LayerVersion.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';

declare const runtime: lambda.Runtime;
const layerVersionAttributes: lambda.LayerVersionAttributes = {
  layerVersionArn: 'layerVersionArn',

  // the properties below are optional
  compatibleRuntimes: [runtime],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

# runtime: lambda.Runtime

layer_version_attributes = lambda.LayerVersionAttributes(
    layer_version_arn="layerVersionArn",

    # the properties below are optional
    compatible_runtimes=[runtime]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;

Runtime runtime;

LayerVersionAttributes layerVersionAttributes = LayerVersionAttributes.builder()
        .layerVersionArn("layerVersionArn")

        // the properties below are optional
        .compatibleRuntimes(List.of(runtime))
        .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.AWS.Lambda;

Runtime runtime;

var layerVersionAttributes = new LayerVersionAttributes {
    LayerVersionArn = "layerVersionArn",

    // the properties below are optional
    CompatibleRuntimes = new [] { runtime }
};
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 "github.com/aws/aws-cdk-go/awscdk"

var runtime Runtime

layerVersionAttributes := &LayerVersionAttributes{
	LayerVersionArn: jsii.String("layerVersionArn"),

	// the properties below are optional
	CompatibleRuntimes: []Runtime{
		runtime,
	},
}

Properties ​

compatibleRuntimesoptionalRuntime[]compatible_runtimesoptionaltyping.List[Runtime]compatibleRuntimesoptionalList<Runtime>CompatibleRuntimesoptionalRuntime[]CompatibleRuntimesoptional*[]Runtime#
The list of compatible runtimes with this Layer.
layerVersionArnstringlayer_version_arnstrlayerVersionArnStringLayerVersionArnstringLayerVersionArn*stringrequired#
The ARN of the LayerVersion.