Class LambdaInvokeAction

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.iotevents.actions.LambdaInvokeAction
All Implemented Interfaces:
IAction, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.932Z") @Stability(Experimental) public class LambdaInvokeAction extends software.amazon.jsii.JsiiObject implements IAction
(experimental) The action to write the data to an AWS Lambda function.

Example:

 import software.amazon.awscdk.services.iotevents.*;
 import software.amazon.awscdk.services.iotevents.actions.*;
 import software.amazon.awscdk.services.lambda.*;
 IFunction func;
 Input input = Input.Builder.create(this, "MyInput")
         .inputName("my_input") // optional
         .attributeJsonPaths(List.of("payload.deviceId", "payload.temperature"))
         .build();
 State warmState = State.Builder.create()
         .stateName("warm")
         .onEnter(List.of(Event.builder()
                 .eventName("test-enter-event")
                 .condition(Expression.currentInput(input))
                 .actions(List.of(new LambdaInvokeAction(func)))
                 .build()))
         .onInput(List.of(Event.builder() // optional
                 .eventName("test-input-event")
                 .actions(List.of(new LambdaInvokeAction(func))).build()))
         .onExit(List.of(Event.builder() // optional
                 .eventName("test-exit-event")
                 .actions(List.of(new LambdaInvokeAction(func))).build()))
         .build();
 State coldState = State.Builder.create()
         .stateName("cold")
         .build();
 // transit to coldState when temperature is less than 15
 warmState.transitionTo(coldState, TransitionOptions.builder()
         .eventName("to_coldState") // optional property, default by combining the names of the States
         .when(Expression.lt(Expression.inputAttribute(input, "payload.temperature"), Expression.fromString("15")))
         .executing(List.of(new LambdaInvokeAction(func)))
         .build());
 // transit to warmState when temperature is greater than or equal to 15
 coldState.transitionTo(warmState, TransitionOptions.builder()
         .when(Expression.gte(Expression.inputAttribute(input, "payload.temperature"), Expression.fromString("15")))
         .build());
 DetectorModel.Builder.create(this, "MyDetectorModel")
         .detectorModelName("test-detector-model") // optional
         .description("test-detector-model-description") // optional property, default is none
         .evaluationMethod(EventEvaluation.SERIAL) // optional property, default is iotevents.EventEvaluation.BATCH
         .detectorKey("payload.deviceId") // optional property, default is none and single detector instance will be created and all inputs will be routed to it
         .initialState(warmState)
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iotevents.IAction

    IAction.Jsii$Default, IAction.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
    protected
    LambdaInvokeAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    LambdaInvokeAction(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    bind(software.constructs.Construct _scope, ActionBindOptions options)
    (experimental) Returns the AWS IoT Events action specification.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • LambdaInvokeAction

      protected LambdaInvokeAction(software.amazon.jsii.JsiiObjectRef objRef)
    • LambdaInvokeAction

      protected LambdaInvokeAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • LambdaInvokeAction

      @Stability(Experimental) public LambdaInvokeAction(@NotNull IFunction func)
      Parameters:
      func - the AWS Lambda function to be invoked by this action. This parameter is required.
  • Method Details

    • bind

      @Stability(Experimental) @NotNull public ActionConfig bind(@NotNull software.constructs.Construct _scope, @NotNull ActionBindOptions options)
      (experimental) Returns the AWS IoT Events action specification.

      Specified by:
      bind in interface IAction
      Parameters:
      _scope - This parameter is required.
      options - This parameter is required.