Class LayerVersion
Defines a new Lambda Layer version.
Inheritance
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.AWS.Lambda.dll
Syntax (csharp)
public class LayerVersion : Resource, ILayerVersion, IResource, IConstruct, IDependable
Syntax (vb)
Public Class LayerVersion
Inherits Resource
Implements ILayerVersion, IResource, IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
new LayerVersion(this, "MyLayer", new LayerVersionProps {
RemovalPolicy = RemovalPolicy.RETAIN,
Code = Code.FromAsset(Join(__dirname, "lambda-handler")),
CompatibleArchitectures = new [] { Architecture.X86_64, Architecture.ARM_64 }
});
Synopsis
Constructors
LayerVersion(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LayerVersion(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
LayerVersion(Construct, String, ILayerVersionProps) |
Properties
CompatibleRuntimes | The runtimes compatible with this Layer. |
LayerVersionArn | The ARN of the Lambda Layer version that this Layer defines. |
Methods
AddPermission(String, ILayerVersionPermission) | Add permission for this layer version to specific entities. |
FromLayerVersionArn(Construct, String, String) | Imports a layer version by ARN. |
FromLayerVersionAttributes(Construct, String, ILayerVersionAttributes) | Imports a Layer that has been defined externally. |
Constructors
LayerVersion(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LayerVersion(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LayerVersion(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LayerVersion(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
LayerVersion(Construct, String, ILayerVersionProps)
public LayerVersion(Construct scope, string id, ILayerVersionProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props ILayerVersionProps
Properties
CompatibleRuntimes
The runtimes compatible with this Layer.
public virtual Runtime[] CompatibleRuntimes { get; }
Property Value
Runtime[]
LayerVersionArn
The ARN of the Lambda Layer version that this Layer defines.
public virtual string LayerVersionArn { get; }
Property Value
System.String
Methods
AddPermission(String, ILayerVersionPermission)
Add permission for this layer version to specific entities.
public virtual void AddPermission(string id, ILayerVersionPermission permission)
Parameters
- id System.String
- permission ILayerVersionPermission
Remarks
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.
FromLayerVersionArn(Construct, String, String)
Imports a layer version by ARN.
public static ILayerVersion FromLayerVersionArn(Construct scope, string id, string layerVersionArn)
Parameters
- scope Constructs.Construct
- id System.String
- layerVersionArn System.String
Returns
Remarks
Assumes it is compatible with all Lambda runtimes.
FromLayerVersionAttributes(Construct, String, ILayerVersionAttributes)
Imports a Layer that has been defined externally.
public static ILayerVersion FromLayerVersionAttributes(Construct scope, string id, ILayerVersionAttributes attrs)
Parameters
- scope Constructs.Construct
the parent Construct that will use the imported layer.
- id System.String
the id of the imported layer in the construct tree.
- attrs ILayerVersionAttributes
the properties of the imported layer.
Returns