@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:54.589Z") public class LayerVersion extends Resource implements ILayerVersion
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();
Modifier and Type | Class and Description |
---|---|
static class |
LayerVersion.Builder
A fluent builder for
LayerVersion . |
ILayerVersion.Jsii$Default, ILayerVersion.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
LayerVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
LayerVersion(software.amazon.jsii.JsiiObjectRef objRef) |
|
LayerVersion(software.constructs.Construct scope,
java.lang.String id,
LayerVersionProps props) |
Modifier and Type | Method and Description |
---|---|
void |
addPermission(java.lang.String id,
LayerVersionPermission permission)
Add permission for this layer version to specific entities.
|
static ILayerVersion |
fromLayerVersionArn(software.constructs.Construct scope,
java.lang.String id,
java.lang.String layerVersionArn)
Imports a layer version by ARN.
|
static ILayerVersion |
fromLayerVersionAttributes(software.constructs.Construct scope,
java.lang.String id,
LayerVersionAttributes attrs)
Imports a Layer that has been defined externally.
|
java.util.List<Runtime> |
getCompatibleRuntimes()
The runtimes compatible with this Layer.
|
java.lang.String |
getLayerVersionArn()
The ARN of the Lambda Layer version that this Layer defines.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected LayerVersion(software.amazon.jsii.JsiiObjectRef objRef)
protected LayerVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public LayerVersion(software.constructs.Construct scope, java.lang.String id, LayerVersionProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static ILayerVersion fromLayerVersionArn(software.constructs.Construct scope, java.lang.String id, java.lang.String layerVersionArn)
Assumes it is compatible with all Lambda runtimes.
scope
- This parameter is required.id
- This parameter is required.layerVersionArn
- This parameter is required.public static ILayerVersion fromLayerVersionAttributes(software.constructs.Construct scope, java.lang.String id, LayerVersionAttributes attrs)
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.public void addPermission(java.lang.String id, LayerVersionPermission permission)
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.
addPermission
in interface ILayerVersion
id
- This parameter is required.permission
- This parameter is required.public java.lang.String getLayerVersionArn()
getLayerVersionArn
in interface ILayerVersion
public java.util.List<Runtime> getCompatibleRuntimes()
getCompatibleRuntimes
in interface ILayerVersion