Class LambdaFunctionAction

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.999Z") @Stability(Experimental) public class LambdaFunctionAction extends software.amazon.jsii.JsiiObject implements IAction
(experimental) The action to invoke an AWS Lambda function, passing in an MQTT message.

Example:

 Function func = Function.Builder.create(this, "MyFunction")
         .runtime(Runtime.NODEJS_14_X)
         .handler("index.handler")
         .code(Code.fromInline("\n    exports.handler = (event) => {\n      console.log(\"It is test for lambda action of AWS IoT Rule.\", event);\n    };"))
         .build();
 TopicRule.Builder.create(this, "TopicRule")
         .sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, timestamp() as timestamp, temperature FROM 'device/+/data'"))
         .actions(List.of(new LambdaFunctionAction(func)))
         .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.iot.IAction

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

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

    Modifier and Type
    Method
    Description
    bind(ITopicRule topicRule)
    (experimental) Returns the topic rule 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

    • LambdaFunctionAction

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

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

      @Stability(Experimental) public LambdaFunctionAction(@NotNull IFunction func)
      Parameters:
      func - The lambda function to be invoked by this action. This parameter is required.
  • Method Details

    • bind

      @Stability(Experimental) @NotNull public ActionConfig bind(@NotNull ITopicRule topicRule)
      (experimental) Returns the topic rule action specification.

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