|env||The environment this resource belongs to.|
|layer||The ARN of the Lambda Layer version that this Layer defines.|
|node||The construct tree node for this construct.|
|stack||The stack in which this resource is defined.|
|compatible||The runtimes compatible with this Layer.|
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
The ARN of the Lambda Layer version that this Layer defines.
The construct tree node for this construct.
The stack in which this resource is defined.
(optional, default: Runtime.All)
The runtimes compatible with this Layer.
|add||Add permission for this layer version to specific entities.|
public addPermission(id: string, permission: LayerVersionPermission): void
string— the ID of the grant in the construct tree.
Layer— the identification of the grantee.
Add permission for this layer version to specific entities.
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
permission on the layer version.