Skip to content
v2.275.0

LambdaExecutionParametersProperty Struct ​

Contains parameters for a Lambda function that runs on AWS IoT Greengrass .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_greengrassv2 as greengrassv2 } from 'aws-cdk-lib';
const lambdaExecutionParametersProperty: greengrassv2.CfnComponentVersion.LambdaExecutionParametersProperty = {
  environmentVariables: {
    environmentVariablesKey: 'environmentVariables',
  },
  eventSources: [{
    topic: 'topic',
    type: 'type',
  }],
  execArgs: ['execArgs'],
  inputPayloadEncodingType: 'inputPayloadEncodingType',
  linuxProcessParams: {
    containerParams: {
      devices: [{
        addGroupOwner: false,
        path: 'path',
        permission: 'permission',
      }],
      memorySizeInKb: 123,
      mountRoSysfs: false,
      volumes: [{
        addGroupOwner: false,
        destinationPath: 'destinationPath',
        permission: 'permission',
        sourcePath: 'sourcePath',
      }],
    },
    isolationMode: 'isolationMode',
  },
  maxIdleTimeInSeconds: 123,
  maxInstancesCount: 123,
  maxQueueSize: 123,
  pinned: false,
  statusTimeoutInSeconds: 123,
  timeoutInSeconds: 123,
};

Properties ​

environmentVariablesoptionalIResolvable | { [key: string]: string }environment_variablesoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]environmentVariablesoptionalIResolvableEnvironmentVariablesoptionalIResolvableEnvironmentVariablesoptionalinterface{}#
The map of environment variables that are available to the Lambda function when it runs.
eventSourcesoptionalIResolvable | IResolvable | CfnComponentVersion.LambdaEventSourceProperty[]event_sourcesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LambdaEventSourceProperty]]]eventSourcesoptionalIResolvableEventSourcesoptionalIResolvableEventSourcesoptionalinterface{}#
The list of event sources to which to subscribe to receive work messages.

The Lambda function runs when it receives a message from an event source. You can subscribe this function to local publish/subscribe messages and AWS IoT Core MQTT messages.

execArgsoptionalstring[]exec_argsoptionaltyping.List[str]execArgsoptionalList<String>ExecArgsoptionalstring[]ExecArgsoptional*[]*string#
The list of arguments to pass to the Lambda function when it runs.
inputPayloadEncodingTypeoptionalstringinput_payload_encoding_typeoptionalstrinputPayloadEncodingTypeoptionalStringInputPayloadEncodingTypeoptionalstringInputPayloadEncodingTypeoptional*string#
The encoding type that the Lambda function supports.

Default: json

linuxProcessParamsoptionalIResolvable | CfnComponentVersion.LambdaLinuxProcessParamsPropertylinux_process_paramsoptionaltyping.Union[IResolvable, LambdaLinuxProcessParamsProperty]linuxProcessParamsoptionalIResolvableLinuxProcessParamsoptionalIResolvableLinuxProcessParamsoptionalinterface{}#
The parameters for the Linux process that contains the Lambda function.
maxIdleTimeInSecondsoptionalnumbermax_idle_time_in_secondsoptionalint | floatmaxIdleTimeInSecondsoptionalNumberMaxIdleTimeInSecondsoptionaldoubleMaxIdleTimeInSecondsoptional*float64#
The maximum amount of time in seconds that a non-pinned Lambda function can idle before the AWS IoT Greengrass Core software stops its process.
maxInstancesCountoptionalnumbermax_instances_countoptionalint | floatmaxInstancesCountoptionalNumberMaxInstancesCountoptionaldoubleMaxInstancesCountoptional*float64#
The maximum number of instances that a non-pinned Lambda function can run at the same time.
maxQueueSizeoptionalnumbermax_queue_sizeoptionalint | floatmaxQueueSizeoptionalNumberMaxQueueSizeoptionaldoubleMaxQueueSizeoptional*float64#
The maximum size of the message queue for the Lambda function component.

The AWS IoT Greengrass core device stores messages in a FIFO (first-in-first-out) queue until it can run the Lambda function to consume each message.

pinnedoptionalboolean | IResolvablepinnedoptionaltyping.Union[bool, IResolvable]pinnedoptionalBooleanPinnedoptionalboolPinnedoptionalinterface{}#
Whether or not the Lambda function is pinned, or long-lived.
notes
  • A pinned Lambda function starts when the AWS IoT Greengrass Core starts and keeps running in its own container.
  • A non-pinned Lambda function starts only when it receives a work item and exists after it idles for maxIdleTimeInSeconds . If the function has multiple work items, the AWS IoT Greengrass Core software creates multiple instances of the function.

Default: true

statusTimeoutInSecondsoptionalnumberstatus_timeout_in_secondsoptionalint | floatstatusTimeoutInSecondsoptionalNumberStatusTimeoutInSecondsoptionaldoubleStatusTimeoutInSecondsoptional*float64#
The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.
timeoutInSecondsoptionalnumbertimeout_in_secondsoptionalint | floattimeoutInSecondsoptionalNumberTimeoutInSecondsoptionaldoubleTimeoutInSecondsoptional*float64#
The maximum amount of time in seconds that the Lambda function can process a work item.