Interface ILayerVersionPermission
Identification of an account (or organization) that is allowed to access a Lambda Layer Version.
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ILayerVersionPermission
Syntax (vb)
Public Interface 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
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. |
Properties
AccountId
The AWS Account id of the account that is authorized to use a Lambda Layer Version.
string AccountId { get; }
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.
virtual string OrganizationId { get; }
Property Value
System.String
Remarks
Can only be specified if accountId
is '*'