Skip to content
v2.276.0

CfnLayerVersionProps Struct ​

Properties for defining a CfnLayerVersion.

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';
const cfnLayerVersionProps: lambda.CfnLayerVersionProps = {
  content: {
    s3Bucket: 's3Bucket',
    s3Key: 's3Key',

    // the properties below are optional
    s3ObjectStorageMode: 's3ObjectStorageMode',
    s3ObjectVersion: 's3ObjectVersion',
  },

  // the properties below are optional
  compatibleArchitectures: ['compatibleArchitectures'],
  compatibleRuntimes: ['compatibleRuntimes'],
  description: 'description',
  layerName: 'layerName',
  licenseInfo: 'licenseInfo',
};
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_

cfn_layer_version_props = lambda.CfnLayerVersionProps(
    content=lambda.CfnLayerVersion.ContentProperty(
        s3_bucket="s3Bucket",
        s3_key="s3Key",

        # the properties below are optional
        s3_object_storage_mode="s3ObjectStorageMode",
        s3_object_version="s3ObjectVersion"
    ),

    # the properties below are optional
    compatible_architectures=["compatibleArchitectures"],
    compatible_runtimes=["compatibleRuntimes"],
    description="description",
    layer_name="layerName",
    license_info="licenseInfo"
)
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.*;

CfnLayerVersionProps cfnLayerVersionProps = CfnLayerVersionProps.builder()
        .content(ContentProperty.builder()
                .s3Bucket("s3Bucket")
                .s3Key("s3Key")

                // the properties below are optional
                .s3ObjectStorageMode("s3ObjectStorageMode")
                .s3ObjectVersion("s3ObjectVersion")
                .build())

        // the properties below are optional
        .compatibleArchitectures(List.of("compatibleArchitectures"))
        .compatibleRuntimes(List.of("compatibleRuntimes"))
        .description("description")
        .layerName("layerName")
        .licenseInfo("licenseInfo")
        .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;

var cfnLayerVersionProps = new CfnLayerVersionProps {
    Content = new ContentProperty {
        S3Bucket = "s3Bucket",
        S3Key = "s3Key",

        // the properties below are optional
        S3ObjectStorageMode = "s3ObjectStorageMode",
        S3ObjectVersion = "s3ObjectVersion"
    },

    // the properties below are optional
    CompatibleArchitectures = new [] { "compatibleArchitectures" },
    CompatibleRuntimes = new [] { "compatibleRuntimes" },
    Description = "description",
    LayerName = "layerName",
    LicenseInfo = "licenseInfo"
};
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"

cfnLayerVersionProps := &CfnLayerVersionProps{
	Content: &ContentProperty{
		S3Bucket: jsii.String("s3Bucket"),
		S3Key: jsii.String("s3Key"),

		// the properties below are optional
		S3ObjectStorageMode: jsii.String("s3ObjectStorageMode"),
		S3ObjectVersion: jsii.String("s3ObjectVersion"),
	},

	// the properties below are optional
	CompatibleArchitectures: []*string{
		jsii.String("compatibleArchitectures"),
	},
	CompatibleRuntimes: []*string{
		jsii.String("compatibleRuntimes"),
	},
	Description: jsii.String("description"),
	LayerName: jsii.String("layerName"),
	LicenseInfo: jsii.String("licenseInfo"),
}

Properties ​

compatibleArchitecturesoptionalstring[]compatible_architecturesoptionaltyping.List[str]compatibleArchitecturesoptionalList<String>CompatibleArchitecturesoptionalstring[]CompatibleArchitecturesoptional*[]*string#
A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html) .
compatibleRuntimesoptionalstring[]compatible_runtimesoptionaltyping.List[str]compatibleRuntimesoptionalList<String>CompatibleRuntimesoptionalstring[]CompatibleRuntimesoptional*[]*string#
A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Used for filtering with [ListLayers](https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayers.html) and [ListLayerVersions](https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayerVersions.html) .
contentIResolvable | CfnLayerVersion.ContentPropertycontenttyping.Union[IResolvable, ContentProperty]contentIResolvableContentIResolvableContentinterface{}required#
The function layer archive.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description of the version.
layerNameoptionalstringlayer_nameoptionalstrlayerNameoptionalStringLayerNameoptionalstringLayerNameoptional*string#
The name or Amazon Resource Name (ARN) of the layer.
licenseInfooptionalstringlicense_infooptionalstrlicenseInfooptionalStringLicenseInfooptionalstringLicenseInfooptional*string#
The layer's software license. It can be any of the following:.
notes
  • An SPDX license identifier . For example, MIT .
  • The URL of a license hosted on the internet. For example, https://opensource.org/licenses/MIT .
  • The full text of the license.