Class InlineCode
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.Code
software.amazon.awscdk.services.lambda.InlineCode
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:40.795Z")
@Stability(Stable)
public class InlineCode
extends Code
Lambda code from an inline string (limited to 4KiB).
Example:
LayerVersion layer = LayerVersion.Builder.create(stack, "MyLayer") .code(Code.fromAsset(join(__dirname, "layer-code"))) .compatibleRuntimes(List.of(Runtime.NODEJS_14_X)) .license("Apache-2.0") .description("A layer to test the L2 construct") .build(); // To grant usage by other AWS accounts layer.addPermission("remote-account-grant", LayerVersionPermission.builder().accountId(awsAccountId).build()); // 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 }); Function.Builder.create(stack, "MyLayeredLambda") .code(new InlineCode("foo")) .handler("index.handler") .runtime(Runtime.NODEJS_14_X) .layers(List.of(layer)) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionInlineCode
(String code) protected
InlineCode
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
InlineCode
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionCalled when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.Determines whether this Code is inline code or not.Methods inherited from class software.amazon.awscdk.services.lambda.Code
asset, bindToResource, bindToResource, bucket, bucket, cfnParameters, cfnParameters, fromAsset, fromAsset, fromAssetImage, fromAssetImage, fromBucket, fromBucket, fromCfnParameters, fromCfnParameters, fromDockerBuild, fromDockerBuild, fromEcrImage, fromEcrImage, fromInline, inline
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
InlineCode
protected InlineCode(software.amazon.jsii.JsiiObjectRef objRef) -
InlineCode
protected InlineCode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
InlineCode
- Parameters:
code
- This parameter is required.
-
-
Method Details
-
bind
Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun. -
getIsInline
Determines whether this Code is inline code or not.- Specified by:
getIsInline
in classCode
-