@Generated(value="jsii-pacmak/1.52.1 (build 5ccc8f6)", date="2022-01-27T11:48:57.643Z") @Stability(value=Stable) public class NodejsFunction extends Function
Example:
NodejsFunction.Builder.create(this, "my-handler")
.bundling(BundlingOptions.builder()
.minify(true) // minify code, defaults to false
.sourceMap(true) // include source map, defaults to false
.sourceMapMode(SourceMapMode.INLINE) // defaults to SourceMapMode.DEFAULT
.sourcesContent(false) // do not include original source into source map, defaults to true
.target("es2020") // target environment for the generated JavaScript code
.loader(Map.of( // Use the 'dataurl' loader for '.png' files
".png", "dataurl"))
.define(Map.of( // Replace strings during build time
"process.env.API_KEY", JSON.stringify("xxx-xxxx-xxx"),
"process.env.PRODUCTION", JSON.stringify(true),
"process.env.NUMBER", JSON.stringify(123)))
.logLevel(LogLevel.SILENT) // defaults to LogLevel.WARNING
.keepNames(true) // defaults to false
.tsconfig("custom-tsconfig.json") // use custom-tsconfig.json instead of default,
.metafile(true) // include meta file, defaults to false
.banner("/* comments */") // requires esbuild >= 0.9.0, defaults to none
.footer("/* comments */") // requires esbuild >= 0.9.0, defaults to none
.charset(Charset.UTF8) // do not escape non-ASCII characters, defaults to Charset.ASCII
.format(OutputFormat.ESM) // ECMAScript module output format, defaults to OutputFormat.CJS (OutputFormat.ESM requires Node.js 14.x)
.mainFields(List.of("module", "main"))
.build())
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
NodejsFunction.Builder
A fluent builder for
NodejsFunction. |
software.amazon.jsii.JsiiObject.InitializationModeIFunction.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
NodejsFunction(Construct scope,
String id) |
|
NodejsFunction(Construct scope,
String id,
NodejsFunctionProps props) |
protected |
NodejsFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
NodejsFunction(software.amazon.jsii.JsiiObjectRef objRef) |
addEnvironment, addEnvironment, addLayers, addVersion, addVersion, addVersion, addVersion, addVersion, classifyVersionProperty, fromFunctionArn, fromFunctionAttributes, getArchitecture, getCanCreatePermissions, getCurrentVersion, getDeadLetterQueue, getFunctionArn, getFunctionName, getGrantPrincipal, getLogGroup, getPermissionsNode, getRole, getRuntime, getTimeout, metricAll, metricAll, metricAllConcurrentExecutions, metricAllConcurrentExecutions, metricAllDuration, metricAllDuration, metricAllErrors, metricAllErrors, metricAllInvocations, metricAllInvocations, metricAllThrottles, metricAllThrottles, metricAllUnreservedConcurrentExecutions, metricAllUnreservedConcurrentExecutionsaddEventSource, addEventSourceMapping, addPermission, addToRolePolicy, configureAsyncInvoke, getConnections, getIsBoundToVpc, getLatestVersion, grantInvoke, metric, metric, metricDuration, metricDuration, metricErrors, metricErrors, metricInvocations, metricInvocations, metricThrottles, metricThrottlesapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected NodejsFunction(software.amazon.jsii.JsiiObjectRef objRef)
protected NodejsFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public NodejsFunction(@NotNull
Construct scope,
@NotNull
String id,
@Nullable
NodejsFunctionProps props)
scope - This parameter is required.id - This parameter is required.props - Copyright © 2022. All rights reserved.