Class NodejsFunctionProps.Jsii$Proxy

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.nodejs.NodejsFunctionProps.Jsii$Proxy
All Implemented Interfaces:
EventInvokeConfigOptions, FunctionOptions, NodejsFunctionProps, software.amazon.jsii.JsiiSerializable
Enclosing interface:
NodejsFunctionProps

@Stability(Stable) @Internal public static final class NodejsFunctionProps.Jsii$Proxy extends software.amazon.jsii.JsiiObject implements NodejsFunctionProps
An implementation for NodejsFunctionProps
  • Constructor Details

    • Jsii$Proxy

      protected Jsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef)
      Constructor that initializes the object based on values retrieved from the JsiiObject.
      Parameters:
      objRef - Reference to the JSII managed object.
    • Jsii$Proxy

      protected Jsii$Proxy(NodejsFunctionProps.Builder builder)
      Constructor that initializes the object based on literal property values passed by the NodejsFunctionProps.Builder.
  • Method Details

    • getAwsSdkConnectionReuse

      public final Boolean getAwsSdkConnectionReuse()
      Description copied from interface: NodejsFunctionProps
      The AWS_NODEJS_CONNECTION_REUSE_ENABLED environment 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_ENABLED environment variable to 1.

      Default: - false (obsolete) for runtimes >= Node 18, true for runtimes invalid input: '<'= Node 16.

      Specified by:
      getAwsSdkConnectionReuse in interface NodejsFunctionProps
      See Also:
    • getBundling

      public final BundlingOptions getBundling()
      Description copied from interface: NodejsFunctionProps
      Bundling options.

      Default: - use default bundling options: no minify, no sourcemap, all modules are bundled.

      Specified by:
      getBundling in interface NodejsFunctionProps
    • getDepsLockFilePath

      public final String getDepsLockFilePath()
      Description copied from interface: NodejsFunctionProps
      The path to the dependencies lock file (yarn.lock, pnpm-lock.yaml or package-lock.json).

      This will be used as the source for the volume mounted in the Docker container.

      Modules specified in nodeModules will be installed using the right installer (yarn, pnpm or npm) along with this lock file.

      Default: - the path is found by walking up parent directories searching for a `yarn.lock`, `pnpm-lock.yaml` or `package-lock.json` file

      Specified by:
      getDepsLockFilePath in interface NodejsFunctionProps
    • getEntry

      public final String getEntry()
      Description copied from interface: NodejsFunctionProps
      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`.

      Specified by:
      getEntry in interface NodejsFunctionProps
    • getHandler

      public final String getHandler()
      Description copied from interface: NodejsFunctionProps
      The name of the exported handler in the entry file.

      The handler is prefixed with index. unless the specified handler value contains a ., in which case it is used as-is.

      Default: handler

      Specified by:
      getHandler in interface NodejsFunctionProps
    • getProjectRoot

      public final String getProjectRoot()
      Description copied from interface: NodejsFunctionProps
      The path to the directory containing project config files (package.json or tsconfig.json).

      Default: - the directory containing the `depsLockFilePath`

      Specified by:
      getProjectRoot in interface NodejsFunctionProps
    • getRuntime

      public final Runtime getRuntime()
      Description copied from interface: NodejsFunctionProps
      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`

      Specified by:
      getRuntime in interface NodejsFunctionProps
    • getAdotInstrumentation

      public final AdotInstrumentationConfig getAdotInstrumentation()
      Description copied from interface: FunctionOptions
      Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.

      Default: - No ADOT instrumentation

      Specified by:
      getAdotInstrumentation in interface FunctionOptions
      See Also:
    • getAllowAllOutbound

      public final Boolean getAllowAllOutbound()
      Description copied from interface: FunctionOptions
      Whether to allow the Lambda to send all network traffic.

      If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.

      Do not specify this property if the securityGroups or securityGroup property is set. Instead, configure allowAllOutbound directly on the security group.

      Default: true

      Specified by:
      getAllowAllOutbound in interface FunctionOptions
    • getAllowPublicSubnet

      public final Boolean getAllowPublicSubnet()
      Description copied from interface: FunctionOptions
      Lambda Functions in a public subnet can NOT access the internet.

      Use this property to acknowledge this limitation and still place the function in a public subnet.

      Default: false

      Specified by:
      getAllowPublicSubnet in interface FunctionOptions
      See Also:
    • getApplicationLogLevel

      public final String getApplicationLogLevel()
      Description copied from interface: FunctionOptions
      Sets the application log level for the function.

      Default: "INFO"

      Specified by:
      getApplicationLogLevel in interface FunctionOptions
    • getArchitecture

      public final Architecture getArchitecture()
      Description copied from interface: FunctionOptions
      The system architectures compatible with this lambda function.

      Default: Architecture.X86_64

      Specified by:
      getArchitecture in interface FunctionOptions
    • getCodeSigningConfig

      public final ICodeSigningConfig getCodeSigningConfig()
      Description copied from interface: FunctionOptions
      Code signing config associated with this function.

      Default: - Not Sign the Code

      Specified by:
      getCodeSigningConfig in interface FunctionOptions
    • getCurrentVersionOptions

      public final VersionOptions getCurrentVersionOptions()
      Description copied from interface: FunctionOptions
      Options for the lambda.Version resource automatically created by the fn.currentVersion method.

      Default: - default options as described in `VersionOptions`

      Specified by:
      getCurrentVersionOptions in interface FunctionOptions
    • getDeadLetterQueue

      public final IQueue getDeadLetterQueue()
      Description copied from interface: FunctionOptions
      The SQS queue to use if DLQ is enabled.

      If SNS topic is desired, specify deadLetterTopic property instead.

      Default: - SQS queue with 14 day retention period if `deadLetterQueueEnabled` is `true`

      Specified by:
      getDeadLetterQueue in interface FunctionOptions
    • getDeadLetterQueueEnabled

      public final Boolean getDeadLetterQueueEnabled()
      Description copied from interface: FunctionOptions
      Enabled DLQ.

      If deadLetterQueue is undefined, an SQS queue with default options will be defined for your Function.

      Default: - false unless `deadLetterQueue` is set, which implies DLQ is enabled.

      Specified by:
      getDeadLetterQueueEnabled in interface FunctionOptions
    • getDeadLetterTopic

      public final ITopic getDeadLetterTopic()
      Description copied from interface: FunctionOptions
      The SNS topic to use as a DLQ.

      Note that if deadLetterQueueEnabled is set to true, an SQS queue will be created rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.

      Default: - no SNS topic

      Specified by:
      getDeadLetterTopic in interface FunctionOptions
    • getDescription

      public final String getDescription()
      Description copied from interface: FunctionOptions
      A description of the function.

      Default: - No description.

      Specified by:
      getDescription in interface FunctionOptions
    • getEnvironment

      public final Map<String,String> getEnvironment()
      Description copied from interface: FunctionOptions
      Key-value pairs that Lambda caches and makes available for your Lambda functions.

      Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code.

      Default: - No environment variables.

      Specified by:
      getEnvironment in interface FunctionOptions
    • getEnvironmentEncryption

      public final IKey getEnvironmentEncryption()
      Description copied from interface: FunctionOptions
      The AWS KMS key that's used to encrypt your function's environment variables.

      Default: - AWS Lambda creates and uses an AWS managed customer master key (CMK).

      Specified by:
      getEnvironmentEncryption in interface FunctionOptions
    • getEphemeralStorageSize

      public final Size getEphemeralStorageSize()
      Description copied from interface: FunctionOptions
      The size of the function’s /tmp directory in MiB.

      Default: 512 MiB

      Specified by:
      getEphemeralStorageSize in interface FunctionOptions
    • getEvents

      public final List<IEventSource> getEvents()
      Description copied from interface: FunctionOptions
      Event sources for this function.

      You can also add event sources using addEventSource.

      Default: - No event sources.

      Specified by:
      getEvents in interface FunctionOptions
    • getFilesystem

      public final FileSystem getFilesystem()
      Description copied from interface: FunctionOptions
      The filesystem configuration for the lambda function.

      Default: - will not mount any filesystem

      Specified by:
      getFilesystem in interface FunctionOptions
    • getFunctionName

      public final String getFunctionName()
      Description copied from interface: FunctionOptions
      A name for the function.

      Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.

      Specified by:
      getFunctionName in interface FunctionOptions
    • getInitialPolicy

      public final List<PolicyStatement> getInitialPolicy()
      Description copied from interface: FunctionOptions
      Initial policy statements to add to the created Lambda Role.

      You can call addToRolePolicy to the created lambda to add statements post creation.

      Default: - No policy statements are added to the created Lambda role.

      Specified by:
      getInitialPolicy in interface FunctionOptions
    • getInsightsVersion

      public final LambdaInsightsVersion getInsightsVersion()
      Description copied from interface: FunctionOptions
      Specify the version of CloudWatch Lambda insights to use for monitoring.

      Default: - No Lambda Insights

      Specified by:
      getInsightsVersion in interface FunctionOptions
      See Also:
    • getIpv6AllowedForDualStack

      public final Boolean getIpv6AllowedForDualStack()
      Description copied from interface: FunctionOptions
      Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

      Only used if 'vpc' is supplied.

      Default: false

      Specified by:
      getIpv6AllowedForDualStack in interface FunctionOptions
    • getLayers

      public final List<ILayerVersion> getLayers()
      Description copied from interface: FunctionOptions
      A list of layers to add to the function's execution environment.

      You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions.

      Default: - No layers.

      Specified by:
      getLayers in interface FunctionOptions
    • getLogFormat

      public final String getLogFormat()
      Description copied from interface: FunctionOptions
      Sets the logFormat for the function.

      Default: "Text"

      Specified by:
      getLogFormat in interface FunctionOptions
    • getLoggingFormat

      public final LoggingFormat getLoggingFormat()
      Description copied from interface: FunctionOptions
      Sets the loggingFormat for the function.

      Default: LoggingFormat.TEXT

      Specified by:
      getLoggingFormat in interface FunctionOptions
    • getLogGroup

      public final ILogGroup getLogGroup()
      Description copied from interface: FunctionOptions
      The log group the function sends logs to.

      By default, Lambda functions send logs to an automatically created default log group named /aws/lambda/. However you cannot change the properties of this auto-created log group using the AWS CDK, e.g. you cannot set a different log retention.

      Use the logGroup property to create a fully customizable LogGroup ahead of time, and instruct the Lambda function to send logs to it.

      Providing a user-controlled log group was rolled out to commercial regions on 2023-11-16. If you are deploying to another type of region, please check regional availability first.

      Default: `/aws/lambda/${this.functionName}` - default log group created by Lambda

      Specified by:
      getLogGroup in interface FunctionOptions
    • getLogRetention

      public final RetentionDays getLogRetention()
      Description copied from interface: FunctionOptions
      The number of days log events are kept in CloudWatch Logs.

      When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.

      This is a legacy API and we strongly recommend you move away from it if you can. Instead create a fully customizable log group with logs.LogGroup and use the logGroup property to instruct the Lambda function to send logs to it. Migrating from logRetention to logGroup will cause the name of the log group to change. Users and code and referencing the name verbatim will have to adjust.

      In AWS CDK code, you can access the log group name directly from the LogGroup construct:

       import software.amazon.awscdk.services.logs.*;
       LogGroup myLogGroup;
       myLogGroup.getLogGroupName();
       

      Default: logs.RetentionDays.INFINITE

      Specified by:
      getLogRetention in interface FunctionOptions
    • getLogRetentionRetryOptions

      public final LogRetentionRetryOptions getLogRetentionRetryOptions()
      Description copied from interface: FunctionOptions
      When log retention is specified, a custom resource attempts to create the CloudWatch log group.

      These options control the retry policy when interacting with CloudWatch APIs.

      This is a legacy API and we strongly recommend you migrate to logGroup if you can. logGroup allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.

      Default: - Default AWS SDK retry options.

      Specified by:
      getLogRetentionRetryOptions in interface FunctionOptions
    • getLogRetentionRole

      public final IRole getLogRetentionRole()
      Description copied from interface: FunctionOptions
      The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

      This is a legacy API and we strongly recommend you migrate to logGroup if you can. logGroup allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.

      Default: - A new role is created.

      Specified by:
      getLogRetentionRole in interface FunctionOptions
    • getMemorySize

      public final Number getMemorySize()
      Description copied from interface: FunctionOptions
      The amount of memory, in MB, that is allocated to your Lambda function.

      Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide.

      Default: 128

      Specified by:
      getMemorySize in interface FunctionOptions
    • getParamsAndSecrets

      public final ParamsAndSecretsLayerVersion getParamsAndSecrets()
      Description copied from interface: FunctionOptions
      Specify the configuration of Parameters and Secrets Extension.

      Default: - No Parameters and Secrets Extension

      Specified by:
      getParamsAndSecrets in interface FunctionOptions
      See Also:
    • getProfiling

      public final Boolean getProfiling()
      Description copied from interface: FunctionOptions
      Enable profiling.

      Default: - No profiling.

      Specified by:
      getProfiling in interface FunctionOptions
      See Also:
    • getProfilingGroup

      public final IProfilingGroup getProfilingGroup()
      Description copied from interface: FunctionOptions
      Profiling Group.

      Default: - A new profiling group will be created if `profiling` is set.

      Specified by:
      getProfilingGroup in interface FunctionOptions
      See Also:
    • getReservedConcurrentExecutions

      public final Number getReservedConcurrentExecutions()
      Description copied from interface: FunctionOptions
      The maximum of concurrent executions you want to reserve for the function.

      Default: - No specific limit - account limit.

      Specified by:
      getReservedConcurrentExecutions in interface FunctionOptions
      See Also:
    • getRole

      public final IRole getRole()
      Description copied from interface: FunctionOptions
      Lambda execution role.

      This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal.

      The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself.

      The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole".

      Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling `addToRolePolicy`.

      Specified by:
      getRole in interface FunctionOptions
    • getRuntimeManagementMode

      public final RuntimeManagementMode getRuntimeManagementMode()
      Description copied from interface: FunctionOptions
      Sets the runtime management configuration for a function's version.

      Default: Auto

      Specified by:
      getRuntimeManagementMode in interface FunctionOptions
    • getSecurityGroups

      public final List<ISecurityGroup> getSecurityGroups()
      Description copied from interface: FunctionOptions
      The list of security groups to associate with the Lambda's network interfaces.

      Only used if 'vpc' is supplied.

      Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.

      Specified by:
      getSecurityGroups in interface FunctionOptions
    • getSnapStart

      public final SnapStartConf getSnapStart()
      Description copied from interface: FunctionOptions
      Enable SnapStart for Lambda Function.

      SnapStart is currently supported only for Java 11, 17 runtime

      Default: - No snapstart

      Specified by:
      getSnapStart in interface FunctionOptions
    • getSystemLogLevel

      public final String getSystemLogLevel()
      Description copied from interface: FunctionOptions
      Sets the system log level for the function.

      Default: "INFO"

      Specified by:
      getSystemLogLevel in interface FunctionOptions
    • getTimeout

      public final Duration getTimeout()
      Description copied from interface: FunctionOptions
      The function execution time (in seconds) after which Lambda terminates the function.

      Because the execution time affects cost, set this value based on the function's expected execution time.

      Default: Duration.seconds(3)

      Specified by:
      getTimeout in interface FunctionOptions
    • getTracing

      public final Tracing getTracing()
      Description copied from interface: FunctionOptions
      Enable AWS X-Ray Tracing for Lambda Function.

      Default: Tracing.Disabled

      Specified by:
      getTracing in interface FunctionOptions
    • getVpc

      public final IVpc getVpc()
      Description copied from interface: FunctionOptions
      VPC network to place Lambda network interfaces.

      Specify this if the Lambda function needs to access resources in a VPC. This is required when vpcSubnets is specified.

      Default: - Function is not placed within a VPC.

      Specified by:
      getVpc in interface FunctionOptions
    • getVpcSubnets

      public final SubnetSelection getVpcSubnets()
      Description copied from interface: FunctionOptions
      Where to place the network interfaces within the VPC.

      This requires vpc to be specified in order for interfaces to actually be placed in the subnets. If vpc is not specify, this will raise an error.

      Note: Internet access for Lambda Functions requires a NAT Gateway, so picking public subnets is not allowed (unless allowPublicSubnet is set to true).

      Default: - the Vpc default strategy if not specified

      Specified by:
      getVpcSubnets in interface FunctionOptions
    • getMaxEventAge

      public final Duration getMaxEventAge()
      Description copied from interface: EventInvokeConfigOptions
      The maximum age of a request that Lambda sends to a function for processing.

      Minimum: 60 seconds Maximum: 6 hours

      Default: Duration.hours(6)

      Specified by:
      getMaxEventAge in interface EventInvokeConfigOptions
    • getOnFailure

      public final IDestination getOnFailure()
      Description copied from interface: EventInvokeConfigOptions
      The destination for failed invocations.

      Default: - no destination

      Specified by:
      getOnFailure in interface EventInvokeConfigOptions
    • getOnSuccess

      public final IDestination getOnSuccess()
      Description copied from interface: EventInvokeConfigOptions
      The destination for successful invocations.

      Default: - no destination

      Specified by:
      getOnSuccess in interface EventInvokeConfigOptions
    • getRetryAttempts

      public final Number getRetryAttempts()
      Description copied from interface: EventInvokeConfigOptions
      The maximum number of times to retry when the function returns an error.

      Minimum: 0 Maximum: 2

      Default: 2

      Specified by:
      getRetryAttempts in interface EventInvokeConfigOptions
    • $jsii$toJson

      @Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson()
      Specified by:
      $jsii$toJson in interface software.amazon.jsii.JsiiSerializable
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object