Class LambdaFunction.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.awscdk.LambdaFunction.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<LambdaFunction>
- Enclosing class:
- LambdaFunction
@Stability(Experimental) public static final class LambdaFunction.Builder extends Object implements software.amazon.jsii.Builder<LambdaFunction>
(experimental) A fluent builder forLambdaFunction.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LambdaFunction.BuilderawsSdkConnectionReuse(Boolean awsSdkConnectionReuse)(experimental) Whether to automatically reuse TCP connections when working with the AWS SDK for JavaScript.LambdaFunctionbuild()LambdaFunction.BuilderbundlingOptions(BundlingOptions bundlingOptions)(experimental) Bundling options for this AWS Lambda function.LambdaFunction.BuildercdkDeps(AwsCdkDeps cdkDeps)(experimental) AWS CDK dependency manager.LambdaFunction.BuilderconstructFile(String constructFile)(experimental) The name of the generated TypeScript source file.LambdaFunction.BuilderconstructName(String constructName)(experimental) The name of the generatedlambda.Functionsubclass.static LambdaFunction.Buildercreate(Project project)LambdaFunction.BuilderedgeLambda(Boolean edgeLambda)(experimental) Whether to create acloudfront.experimental.EdgeFunctioninstead of alambda.Function.LambdaFunction.Builderentrypoint(String entrypoint)(experimental) A path from the project root directory to a TypeScript file which contains the AWS Lambda handler entrypoint (exports ahandlerfunction).LambdaFunction.Builderruntime(LambdaRuntime runtime)(experimental) The node.js version to target.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static LambdaFunction.Builder create(Project project)
- Parameters:
project- The project to use. This parameter is required.- Returns:
- a new instance of
LambdaFunction.Builder.
-
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_ENABLEDenvironment variable to1.Not applicable when
edgeLambdais set totruebecause 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
Bundlerinstance 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 acloudfront.experimental.EdgeFunctioninstead of alambda.Function.Default: false
- Parameters:
edgeLambda- Whether to create acloudfront.experimental.EdgeFunctioninstead of alambda.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 ahandlerfunction).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 ahandlerfunction). 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 generatedlambda.Functionsubclass.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 generatedlambda.Functionsubclass. This parameter is required.- Returns:
this
-
build
@Stability(Experimental) public LambdaFunction build()
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<LambdaFunction>- Returns:
- a newly built instance of
LambdaFunction.
-
-