Class LambdaFunctionAction
(experimental) The action to invoke an AWS Lambda function, passing in an MQTT message.
Inheritance
System.Object
LambdaFunctionAction
Implements
Namespace: Amazon.CDK.AWS.IoT.Actions
Assembly: Amazon.CDK.AWS.IoT.Actions.dll
Syntax (csharp)
public class LambdaFunctionAction : DeputyBase, IAction
Syntax (vb)
Public Class LambdaFunctionAction
Inherits DeputyBase
Implements IAction
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
var func = new Function(this, "MyFunction", new FunctionProps {
Runtime = Runtime.NODEJS_14_X,
Handler = "index.handler",
Code = Code.FromInline(@"
exports.handler = (event) => {
console.log(""It is test for lambda action of AWS IoT Rule."", event);
};")
});
new TopicRule(this, "TopicRule", new TopicRuleProps {
Sql = IotSql.FromStringAsVer20160323("SELECT topic(2) as device_id, timestamp() as timestamp, temperature FROM 'device/+/data'"),
Actions = new [] { new LambdaFunctionAction(func) }
});
Synopsis
Constructors
LambdaFunctionAction(IFunction) | |
LambdaFunctionAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LambdaFunctionAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(ITopicRule) | (experimental) Returns the topic rule action specification. |
Constructors
LambdaFunctionAction(IFunction)
public LambdaFunctionAction(IFunction func)
Parameters
- func IFunction
The lambda function to be invoked by this action.
Remarks
Stability: Experimental
LambdaFunctionAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LambdaFunctionAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LambdaFunctionAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LambdaFunctionAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(ITopicRule)
(experimental) Returns the topic rule action specification.
public virtual IActionConfig Bind(ITopicRule topicRule)
Parameters
- topicRule ITopicRule
Returns
Remarks
Stability: Experimental