Interface NodejsFunctionProps
- All Superinterfaces:
EventInvokeConfigOptions,FunctionOptions,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
NodejsFunctionProps.Jsii$Proxy
Example:
NodejsFunction.Builder.create(this, "my-handler")
.bundling(BundlingOptions.builder()
.network("host")
.securityOpt("no-new-privileges")
.user("user:group")
.volumesFrom(List.of("777f7dc92da7"))
.volumes(List.of(DockerVolume.builder().hostPath("/host-path").containerPath("/container-path").build()))
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forNodejsFunctionPropsstatic final classAn implementation forNodejsFunctionProps -
Method Summary
Modifier and TypeMethodDescriptionstatic NodejsFunctionProps.Builderbuilder()default BooleanTheAWS_NODEJS_CONNECTION_REUSE_ENABLEDenvironment variable does not exist in the AWS SDK for JavaScript v3.default BundlingOptionsBundling options.default CodegetCode()The code that will be deployed to the Lambda Handler.default StringThe path to the dependencies lock file (yarn.lock,pnpm-lock.yaml,bun.lockb,bun.lockorpackage-lock.json).default StringgetEntry()Path to the entry file (JavaScript or TypeScript).default StringThe name of the exported handler in the entry file.default StringThe path to the directory containing project config files (package.jsonortsconfig.json).default RuntimeThe runtime environment.Methods inherited from interface software.amazon.awscdk.services.lambda.EventInvokeConfigOptions
getMaxEventAge, getOnFailure, getOnSuccess, getRetryAttemptsMethods inherited from interface software.amazon.awscdk.services.lambda.FunctionOptions
getAdotInstrumentation, getAllowAllIpv6Outbound, getAllowAllOutbound, getAllowPublicSubnet, getApplicationLogLevel, getApplicationLogLevelV2, getArchitecture, getCodeSigningConfig, getCurrentVersionOptions, getDeadLetterQueue, getDeadLetterQueueEnabled, getDeadLetterTopic, getDescription, getEnvironment, getEnvironmentEncryption, getEphemeralStorageSize, getEvents, getFilesystem, getFunctionName, getInitialPolicy, getInsightsVersion, getIpv6AllowedForDualStack, getLayers, getLogFormat, getLoggingFormat, getLogGroup, getLogRemovalPolicy, getLogRetention, getLogRetentionRetryOptions, getLogRetentionRole, getMemorySize, getParamsAndSecrets, getProfiling, getProfilingGroup, getRecursiveLoop, getReservedConcurrentExecutions, getRole, getRuntimeManagementMode, getSecurityGroups, getSnapStart, getSystemLogLevel, getSystemLogLevelV2, getTimeout, getTracing, getVpc, getVpcSubnetsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAwsSdkConnectionReuse
TheAWS_NODEJS_CONNECTION_REUSE_ENABLEDenvironment variable does not exist in the AWS SDK for JavaScript v3.This prop will be deprecated when the Lambda Node16 runtime is deprecated on June 12, 2024. See https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy
Info for Node 16 runtimes / SDK v2 users:
Whether to automatically reuse TCP connections when working with the AWS SDK for JavaScript v2.
This sets the
AWS_NODEJS_CONNECTION_REUSE_ENABLEDenvironment variable to1.Default: - false (obsolete) for runtimes >= Node 18, true for runtimes invalid input: '<'= Node 16.
- See Also:
-
getBundling
Bundling options.Default: - use default bundling options: no minify, no sourcemap, all modules are bundled.
-
getCode
The code that will be deployed to the Lambda Handler.If included, then properties related to bundling of the code are ignored.
- If the
codefield is specified, then you must include thehandlerproperty.
Default: - the code is bundled by esbuild
- If the
-
getDepsLockFilePath
The path to the dependencies lock file (yarn.lock,pnpm-lock.yaml,bun.lockb,bun.lockorpackage-lock.json).This will be used as the source for the volume mounted in the Docker container.
Modules specified in
nodeModuleswill be installed using the right installer (yarn,pnpm,bunornpm) along with this lock file.Default: - the path is found by walking up parent directories searching for a `yarn.lock`, `pnpm-lock.yaml`, `bun.lockb`, `bun.lock` or `package-lock.json` file
-
getEntry
Path to the entry file (JavaScript or TypeScript).Default: - Derived from the name of the defining file and the construct's id. If the `NodejsFunction` is defined in `stack.ts` with `my-handler` as id (`new NodejsFunction(this, 'my-handler')`), the construct will look at `stack.my-handler.ts` and `stack.my-handler.js`.
-
getHandler
The name of the exported handler in the entry file.- If the
codeproperty is supplied, then you must include thehandlerproperty. The handler should be the name of the file that contains the exported handler and the function that should be called when the AWS Lambda is invoked. For example, if you had a file calledmyLambda.jsand the function to be invoked wasmyHandler, then you should inputhandlerproperty asmyLambda.myHandler. - If the
codeproperty is not supplied and the handler input does not contain a., then the handler is prefixed withindex.(index period). Otherwise, the handler property is not modified.
Default: handler
- If the
-
getProjectRoot
The path to the directory containing project config files (package.jsonortsconfig.json).Default: - the directory containing the `depsLockFilePath`
-
getRuntime
The runtime environment.Only runtimes of the Node.js family are supported.
Default: `Runtime.NODEJS_LATEST` if the `@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion` feature flag is enabled, otherwise `Runtime.NODEJS_16_X`
-
builder
- Returns:
- a
NodejsFunctionProps.BuilderofNodejsFunctionProps
-