Class: AWSCDK::Greengrassv2::CfnComponentVersion::LambdaExecutionParametersProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
greengrassv2/cfn_component_version.rb

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment_variables: nil, event_sources: nil, exec_args: nil, input_payload_encoding_type: nil, linux_process_params: nil, max_idle_time_in_seconds: nil, max_instances_count: nil, max_queue_size: nil, pinned: nil, status_timeout_in_seconds: nil, timeout_in_seconds: nil) ⇒ LambdaExecutionParametersProperty

Returns a new instance of LambdaExecutionParametersProperty.

Parameters:

  • environment_variables (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    The map of environment variables that are available to the Lambda function when it runs.

  • event_sources (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Greengrassv2::CfnComponentVersion::LambdaEventSourceProperty>, nil) (defaults to: nil)

    The list of event sources to which to subscribe to receive work messages.

  • exec_args (Array<String>, nil) (defaults to: nil)

    The list of arguments to pass to the Lambda function when it runs.

  • input_payload_encoding_type (String, nil) (defaults to: nil)

    The encoding type that the Lambda function supports.

  • linux_process_params (AWSCDK::IResolvable, AWSCDK::Greengrassv2::CfnComponentVersion::LambdaLinuxProcessParamsProperty, nil) (defaults to: nil)

    The parameters for the Linux process that contains the Lambda function.

  • max_idle_time_in_seconds (Numeric, nil) (defaults to: nil)

    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.

  • max_instances_count (Numeric, nil) (defaults to: nil)

    The maximum number of instances that a non-pinned Lambda function can run at the same time.

  • max_queue_size (Numeric, nil) (defaults to: nil)

    The maximum size of the message queue for the Lambda function component.

  • pinned (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Whether or not the Lambda function is pinned, or long-lived.

  • status_timeout_in_seconds (Numeric, nil) (defaults to: nil)

    The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.

  • timeout_in_seconds (Numeric, nil) (defaults to: nil)

    The maximum amount of time in seconds that the Lambda function can process a work item.



856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
# File 'greengrassv2/cfn_component_version.rb', line 856

def initialize(environment_variables: nil, event_sources: nil, exec_args: nil, input_payload_encoding_type: nil, linux_process_params: nil, max_idle_time_in_seconds: nil, max_instances_count: nil, max_queue_size: nil, pinned: nil, status_timeout_in_seconds: nil, timeout_in_seconds: nil)
  @environment_variables = environment_variables
  Jsii::Type.check_type(@environment_variables, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "environmentVariables") unless @environment_variables.nil?
  @event_sources = event_sources
  Jsii::Type.check_type(@event_sources, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZ3JlZW5ncmFzc3YyLkNmbkNvbXBvbmVudFZlcnNpb24uTGFtYmRhRXZlbnRTb3VyY2VQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "eventSources") unless @event_sources.nil?
  @exec_args = exec_args
  Jsii::Type.check_type(@exec_args, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "execArgs") unless @exec_args.nil?
  @input_payload_encoding_type = input_payload_encoding_type
  Jsii::Type.check_type(@input_payload_encoding_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inputPayloadEncodingType") unless @input_payload_encoding_type.nil?
  @linux_process_params = linux_process_params.is_a?(Hash) ? ::AWSCDK::Greengrassv2::CfnComponentVersion::LambdaLinuxProcessParamsProperty.new(**linux_process_params.transform_keys(&:to_sym)) : linux_process_params
  Jsii::Type.check_type(@linux_process_params, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ncmVlbmdyYXNzdjIuQ2ZuQ29tcG9uZW50VmVyc2lvbi5MYW1iZGFMaW51eFByb2Nlc3NQYXJhbXNQcm9wZXJ0eSJ9XX19")), "linuxProcessParams") unless @linux_process_params.nil?
  @max_idle_time_in_seconds = max_idle_time_in_seconds
  Jsii::Type.check_type(@max_idle_time_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxIdleTimeInSeconds") unless @max_idle_time_in_seconds.nil?
  @max_instances_count = max_instances_count
  Jsii::Type.check_type(@max_instances_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxInstancesCount") unless @max_instances_count.nil?
  @max_queue_size = max_queue_size
  Jsii::Type.check_type(@max_queue_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxQueueSize") unless @max_queue_size.nil?
  @pinned = pinned
  Jsii::Type.check_type(@pinned, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "pinned") unless @pinned.nil?
  @status_timeout_in_seconds = status_timeout_in_seconds
  Jsii::Type.check_type(@status_timeout_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "statusTimeoutInSeconds") unless @status_timeout_in_seconds.nil?
  @timeout_in_seconds = timeout_in_seconds
  Jsii::Type.check_type(@timeout_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "timeoutInSeconds") unless @timeout_in_seconds.nil?
end

Instance Attribute Details

#environment_variablesAWSCDK::IResolvable, ... (readonly)

The map of environment variables that are available to the Lambda function when it runs.



885
886
887
# File 'greengrassv2/cfn_component_version.rb', line 885

def environment_variables
  @environment_variables
end

#event_sourcesAWSCDK::IResolvable, ... (readonly)

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.



892
893
894
# File 'greengrassv2/cfn_component_version.rb', line 892

def event_sources
  @event_sources
end

#exec_argsArray<String>? (readonly)

The list of arguments to pass to the Lambda function when it runs.



897
898
899
# File 'greengrassv2/cfn_component_version.rb', line 897

def exec_args
  @exec_args
end

#input_payload_encoding_typeString? (readonly)

The encoding type that the Lambda function supports.

Default: json



904
905
906
# File 'greengrassv2/cfn_component_version.rb', line 904

def input_payload_encoding_type
  @input_payload_encoding_type
end

#linux_process_paramsAWSCDK::IResolvable, ... (readonly)

The parameters for the Linux process that contains the Lambda function.



909
910
911
# File 'greengrassv2/cfn_component_version.rb', line 909

def linux_process_params
  @linux_process_params
end

#max_idle_time_in_secondsNumeric? (readonly)

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.



914
915
916
# File 'greengrassv2/cfn_component_version.rb', line 914

def max_idle_time_in_seconds
  @max_idle_time_in_seconds
end

#max_instances_countNumeric? (readonly)

The maximum number of instances that a non-pinned Lambda function can run at the same time.



919
920
921
# File 'greengrassv2/cfn_component_version.rb', line 919

def max_instances_count
  @max_instances_count
end

#max_queue_sizeNumeric? (readonly)

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.



926
927
928
# File 'greengrassv2/cfn_component_version.rb', line 926

def max_queue_size
  @max_queue_size
end

#pinnedBoolean, ... (readonly)

Whether or not the Lambda function is pinned, or long-lived.

  • 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 max_idle_time_in_seconds . If the function has multiple work items, the AWS IoT Greengrass Core software creates multiple instances of the function.

Default: true



936
937
938
# File 'greengrassv2/cfn_component_version.rb', line 936

def pinned
  @pinned
end

#status_timeout_in_secondsNumeric? (readonly)

The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.



941
942
943
# File 'greengrassv2/cfn_component_version.rb', line 941

def status_timeout_in_seconds
  @status_timeout_in_seconds
end

#timeout_in_secondsNumeric? (readonly)

The maximum amount of time in seconds that the Lambda function can process a work item.



946
947
948
# File 'greengrassv2/cfn_component_version.rb', line 946

def timeout_in_seconds
  @timeout_in_seconds
end

Class Method Details

.jsii_propertiesObject



948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
# File 'greengrassv2/cfn_component_version.rb', line 948

def self.jsii_properties
  {
    :environment_variables => "environmentVariables",
    :event_sources => "eventSources",
    :exec_args => "execArgs",
    :input_payload_encoding_type => "inputPayloadEncodingType",
    :linux_process_params => "linuxProcessParams",
    :max_idle_time_in_seconds => "maxIdleTimeInSeconds",
    :max_instances_count => "maxInstancesCount",
    :max_queue_size => "maxQueueSize",
    :pinned => "pinned",
    :status_timeout_in_seconds => "statusTimeoutInSeconds",
    :timeout_in_seconds => "timeoutInSeconds",
  }
end

Instance Method Details

#to_jsiiObject



964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
# File 'greengrassv2/cfn_component_version.rb', line 964

def to_jsii
  result = {}
  result.merge!({
    "environmentVariables" => @environment_variables,
    "eventSources" => @event_sources,
    "execArgs" => @exec_args,
    "inputPayloadEncodingType" => @input_payload_encoding_type,
    "linuxProcessParams" => @linux_process_params,
    "maxIdleTimeInSeconds" => @max_idle_time_in_seconds,
    "maxInstancesCount" => @max_instances_count,
    "maxQueueSize" => @max_queue_size,
    "pinned" => @pinned,
    "statusTimeoutInSeconds" => @status_timeout_in_seconds,
    "timeoutInSeconds" => @timeout_in_seconds,
  })
  result.compact
end