Class LayerVersionPermission
Identification of an account (or organization) that is allowed to access a Lambda Layer Version.
Inheritance
System.Object
LayerVersionPermission
Implements
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LayerVersionPermission : Object, ILayerVersionPermission
Syntax (vb)
Public Class LayerVersionPermission
Inherits Object
Implements ILayerVersionPermission
Remarks
ExampleMetadata: lit=aws-lambda/test/integ.layer-version.lit.ts infused
Examples
var layer = new LayerVersion(stack, "MyLayer", new LayerVersionProps {
Code = Code.FromAsset(Join(__dirname, "layer-code")),
CompatibleRuntimes = new [] { Runtime.NODEJS_LATEST },
License = "Apache-2.0",
Description = "A layer to test the L2 construct"
});
// To grant usage by other AWS accounts
layer.AddPermission("remote-account-grant", new LayerVersionPermission { AccountId = awsAccountId });
// To grant usage to all accounts in some AWS Ogranization
// layer.grantUsage({ accountId: '*', organizationId });
// To grant usage to all accounts in some AWS Ogranization
// layer.grantUsage({ accountId: '*', organizationId });
new Function(stack, "MyLayeredLambda", new FunctionProps {
Code = new InlineCode("foo"),
Handler = "index.handler",
Runtime = Runtime.NODEJS_LATEST,
Layers = new [] { layer }
});
Synopsis
Constructors
LayerVersionPermission() |
Properties
AccountId | The AWS Account id of the account that is authorized to use a Lambda Layer Version. |
OrganizationId | The ID of the AWS Organization to which the grant is restricted. |
Constructors
LayerVersionPermission()
public LayerVersionPermission()
Properties
AccountId
The AWS Account id of the account that is authorized to use a Lambda Layer Version.
public string AccountId { get; set; }
Property Value
System.String
Remarks
The wild-card '*'
can be
used to grant access to "any" account (or any account in an organization when organizationId
is specified).
OrganizationId
The ID of the AWS Organization to which the grant is restricted.
public string OrganizationId { get; set; }
Property Value
System.String
Remarks
Can only be specified if accountId
is '*'