Class LayerVersion
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.lambda.LayerVersion
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,ILayerVersion
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
- Direct Known Subclasses:
AwsCliLayer
,KubectlLayer
,NodeProxyAgentLayer
,PythonLayerVersion
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:40.798Z")
@Stability(Stable)
public class LayerVersion
extends Resource
implements ILayerVersion
Defines a new Lambda Layer version.
Example:
LayerVersion.Builder.create(this, "MyLayer") .removalPolicy(RemovalPolicy.RETAIN) .code(Code.fromAsset(join(__dirname, "lambda-handler"))) .compatibleArchitectures(List.of(Architecture.X86_64, Architecture.ARM_64)) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.ILayerVersion
ILayerVersion.Jsii$Default, ILayerVersion.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
LayerVersion
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
LayerVersion
(software.amazon.jsii.JsiiObjectRef objRef) LayerVersion
(software.constructs.Construct scope, String id, LayerVersionProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPermission
(String id, LayerVersionPermission permission) Add permission for this layer version to specific entities.static ILayerVersion
fromLayerVersionArn
(software.constructs.Construct scope, String id, String layerVersionArn) Imports a layer version by ARN.static ILayerVersion
fromLayerVersionAttributes
(software.constructs.Construct scope, String id, LayerVersionAttributes attrs) Imports a Layer that has been defined externally.The runtimes compatible with this Layer.The ARN of the Lambda Layer version that this Layer defines.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
LayerVersion
protected LayerVersion(software.amazon.jsii.JsiiObjectRef objRef) -
LayerVersion
protected LayerVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
LayerVersion
@Stability(Stable) public LayerVersion(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull LayerVersionProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromLayerVersionArn
@Stability(Stable) @NotNull public static ILayerVersion fromLayerVersionArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String layerVersionArn) Imports a layer version by ARN.Assumes it is compatible with all Lambda runtimes.
- Parameters:
scope
- This parameter is required.id
- This parameter is required.layerVersionArn
- This parameter is required.
-
fromLayerVersionAttributes
@Stability(Stable) @NotNull public static ILayerVersion fromLayerVersionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull LayerVersionAttributes attrs) Imports a Layer that has been defined externally.- Parameters:
scope
- the parent Construct that will use the imported layer. This parameter is required.id
- the id of the imported layer in the construct tree. This parameter is required.attrs
- the properties of the imported layer. This parameter is required.
-
addPermission
@Stability(Stable) public void addPermission(@NotNull String id, @NotNull LayerVersionPermission permission) Add permission for this layer version to specific entities.Usage within the same account where the layer is defined is always allowed and does not require calling this method. Note that the principal that creates the Lambda function using the layer (for example, a CloudFormation changeset execution role) also needs to have the
lambda:GetLayerVersion
permission on the layer version.- Specified by:
addPermission
in interfaceILayerVersion
- Parameters:
id
- This parameter is required.permission
- This parameter is required.
-
getLayerVersionArn
The ARN of the Lambda Layer version that this Layer defines.- Specified by:
getLayerVersionArn
in interfaceILayerVersion
-
getCompatibleRuntimes
The runtimes compatible with this Layer.- Specified by:
getCompatibleRuntimes
in interfaceILayerVersion
-