All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.iot.actions.alpha.LambdaFunctionAction Maven / Gradle / Ivy

There is a newer version: 2.167.1-alpha.0
Show newest version
package software.amazon.awscdk.services.iot.actions.alpha;

/**
 * (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_LATEST)
 *         .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();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-11T15:56:08.452Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.iot.actions.alpha.$Module.class, fqn = "@aws-cdk/aws-iot-actions-alpha.LambdaFunctionAction") public class LambdaFunctionAction extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.iot.alpha.IAction { protected LambdaFunctionAction(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected LambdaFunctionAction(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } /** * @param func The lambda function to be invoked by this action. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public LambdaFunctionAction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction func) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(func, "func is required") }); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy