Class InlineCode
Lambda code from an inline string (limited to 4KiB).
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.AWS.Lambda.dll
Syntax (csharp)
public class InlineCode : Code
Syntax (vb)
Public Class InlineCode
Inherits Code
Remarks
ExampleMetadata: lit=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_14_X },
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_14_X,
Layers = new [] { layer }
});
Synopsis
Constructors
InlineCode(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
InlineCode(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
InlineCode(String) |
Properties
IsInline | Determines whether this Code is inline code or not. |
Methods
Bind(Construct) | Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. |
Constructors
InlineCode(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected InlineCode(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
InlineCode(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected InlineCode(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
InlineCode(String)
public InlineCode(string code)
Parameters
- code System.String
Properties
IsInline
Determines whether this Code is inline code or not.
public override bool IsInline { get; }
Property Value
System.Boolean
Overrides
Methods
Bind(Construct)
Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.
public override ICodeConfig Bind(Construct scope)
Parameters
- scope Construct
Returns