Package io.github.cdklabs.projen.awscdk
Class LambdaFunction
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- io.github.cdklabs.projen.Component
-
- io.github.cdklabs.projen.awscdk.LambdaFunction
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-03-28T21:16:42.946Z") @Stability(Experimental) public class LambdaFunction extends Component
(experimental) Generates a pre-bundled AWS Lambda function construct from handler code.To use this, create an AWS Lambda handler file under your source tree with the
.lambda.tsextension and add aLambdaFunctioncomponent to your typescript project pointing to this entrypoint.This will add a task to your "compile" step which will use
esbuildto bundle the handler code into the build directory. It will also generate a filesrc/foo-function.tswith a custom AWS construct calledFooFunctionwhich extends@aws-cdk/aws-lambda.Functionwhich is bound to the bundled handle through an asset.Example:
new LambdaFunction(myProject, { srcdir: myProject.srcdir, entrypoint: 'src/foo.lambda.ts', });
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLambdaFunction.Builder(experimental) A fluent builder forLambdaFunction.
-
Constructor Summary
Constructors Modifier Constructor Description LambdaFunction(Project project, LambdaFunctionOptions options)(experimental) Defines a pre-bundled AWS Lambda function construct from handler code.protectedLambdaFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedLambdaFunction(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
-
Methods inherited from class io.github.cdklabs.projen.Component
getProject, isComponent, postSynthesize, preSynthesize, synthesize
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
LambdaFunction
protected LambdaFunction(software.amazon.jsii.JsiiObjectRef objRef)
-
LambdaFunction
protected LambdaFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
LambdaFunction
@Stability(Experimental) public LambdaFunction(@NotNull Project project, @NotNull LambdaFunctionOptions options)(experimental) Defines a pre-bundled AWS Lambda function construct from handler code.- Parameters:
project- The project to use. This parameter is required.options- Options. This parameter is required.
-
-