Class LambdaFunction.Builder

    • Method Detail

      • awsSdkConnectionReuse

        @Stability(Experimental)
        public LambdaFunction.Builder awsSdkConnectionReuse​(Boolean awsSdkConnectionReuse)
        (experimental) Whether to automatically reuse TCP connections when working with the AWS SDK for JavaScript.

        This sets the AWS_NODEJS_CONNECTION_REUSE_ENABLED environment variable to 1.

        Not applicable when edgeLambda is set to true because environment variables are not supported in Lambda@Edge.

        Default: true

        Parameters:
        awsSdkConnectionReuse - Whether to automatically reuse TCP connections when working with the AWS SDK for JavaScript. This parameter is required.
        Returns:
        this
        See Also:
        https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
      • bundlingOptions

        @Stability(Experimental)
        public LambdaFunction.Builder bundlingOptions​(BundlingOptions bundlingOptions)
        (experimental) Bundling options for this AWS Lambda function.

        If not specified the default bundling options specified for the project Bundler instance will be used.

        Default: - defaults

        Parameters:
        bundlingOptions - Bundling options for this AWS Lambda function. This parameter is required.
        Returns:
        this
      • edgeLambda

        @Stability(Experimental)
        public LambdaFunction.Builder edgeLambda​(Boolean edgeLambda)
        (experimental) Whether to create a cloudfront.experimental.EdgeFunction instead of a lambda.Function.

        Default: false

        Parameters:
        edgeLambda - Whether to create a cloudfront.experimental.EdgeFunction instead of a lambda.Function. This parameter is required.
        Returns:
        this
      • runtime

        @Stability(Experimental)
        public LambdaFunction.Builder runtime​(LambdaRuntime runtime)
        (experimental) The node.js version to target.

        Default: Runtime.NODEJS_18_X

        Parameters:
        runtime - The node.js version to target. This parameter is required.
        Returns:
        this
      • cdkDeps

        @Stability(Experimental)
        public LambdaFunction.Builder cdkDeps​(AwsCdkDeps cdkDeps)
        (experimental) AWS CDK dependency manager.

        Parameters:
        cdkDeps - AWS CDK dependency manager. This parameter is required.
        Returns:
        this
      • entrypoint

        @Stability(Experimental)
        public LambdaFunction.Builder entrypoint​(String entrypoint)
        (experimental) A path from the project root directory to a TypeScript file which contains the AWS Lambda handler entrypoint (exports a handler function).

        This is relative to the root directory of the project.

        Example:

         "src/subdir/foo.lambda.ts"
         

        Parameters:
        entrypoint - A path from the project root directory to a TypeScript file which contains the AWS Lambda handler entrypoint (exports a handler function). This parameter is required.
        Returns:
        this
      • constructFile

        @Stability(Experimental)
        public LambdaFunction.Builder constructFile​(String constructFile)
        (experimental) The name of the generated TypeScript source file.

        This file should also be under the source tree.

        Default: - The name of the entrypoint file, with the `-function.ts` suffix instead of `.lambda.ts`.

        Parameters:
        constructFile - The name of the generated TypeScript source file. This parameter is required.
        Returns:
        this
      • constructName

        @Stability(Experimental)
        public LambdaFunction.Builder constructName​(String constructName)
        (experimental) The name of the generated lambda.Function subclass.

        Default: - A pascal cased version of the name of the entrypoint file, with the extension `Function` (e.g. `ResizeImageFunction`).

        Parameters:
        constructName - The name of the generated lambda.Function subclass. This parameter is required.
        Returns:
        this