Skip to content
v2.277.0

Experimental

@aws-cdk/aws-lambda-python-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

PythonLayerVersionProps Struct ​

Properties for PythonLayerVersion.

Example ​

ts
new python.PythonLayerVersion(this, 'MyLayer', {
  entry: '/path/to/my/layer', // point this to your library's directory
})
python
python.PythonLayerVersion(self, "MyLayer",
    entry="/path/to/my/layer"
)
java
PythonLayerVersion.Builder.create(this, "MyLayer")
        .entry("/path/to/my/layer")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Lambda.Python.Alpha
new PythonLayerVersion(this, "MyLayer", new PythonLayerVersionProps {
    Entry = "/path/to/my/layer"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdklambdapythonalpha/v2
python.NewPythonLayerVersion(this, jsii.String("MyLayer"), &PythonLayerVersionProps{
	Entry: jsii.String("/path/to/my/layer"),
})

Properties ​

bundlingoptionalBundlingOptionsbundlingoptionalBundlingOptionsbundlingoptionalBundlingOptionsBundlingoptionalBundlingOptionsBundlingoptionalBundlingOptions #
Bundling options to use for this function.

Default: Use the default bundling Docker image, with x86_64 architecture.

Use this to specify custom bundling options like the bundling Docker image, asset hash type, custom hash, architecture, etc.

compatibleArchitecturesoptionalArchitecture[]compatible_architecturesoptionaltyping.List[Architecture]compatibleArchitecturesoptionalList<Architecture>CompatibleArchitecturesoptionalArchitecture[]CompatibleArchitecturesoptional*[]Architecture = [Architecture.X86_64] #
The system architectures compatible with this layer.
compatibleRuntimesoptionalRuntime[]compatible_runtimesoptionaltyping.List[Runtime]compatibleRuntimesoptionalList<Runtime>CompatibleRuntimesoptionalRuntime[]CompatibleRuntimesoptional*[]Runtime #
The runtimes compatible with the python layer.

Default: Only Python 3.7 is supported.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
The description the this Lambda Layer.

Default: No description.

entrystringentrystrentryStringEntrystringEntry*string required #
The path to the root directory of the lambda layer.
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.