Class 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.ts extension and add a LambdaFunction component to your typescript project pointing to this entrypoint.

    This will add a task to your "compile" step which will use esbuild to bundle the handler code into the build directory. It will also generate a file src/foo-function.ts with a custom AWS construct called FooFunction which extends @aws-cdk/aws-lambda.Function which 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 class  LambdaFunction.Builder
      (experimental) A fluent builder for LambdaFunction.
      • Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

        software.amazon.jsii.JsiiObject.InitializationMode
      • Nested classes/interfaces inherited from interface software.constructs.IConstruct

        software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        LambdaFunction​(Project project, LambdaFunctionOptions options)
      (experimental) Defines a pre-bundled AWS Lambda function construct from handler code.
      protected LambdaFunction​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  
      protected LambdaFunction​(software.amazon.jsii.JsiiObjectRef objRef)  
    • 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.