I'm currently unable to create an IoT topic rule that calls a lambda function.
When I configure my rule in the IoT web interface, I am able to define the rule as well as an action that calls my lambda function. However after I save the rule and go to the lambda interface, it says there is no action associated with the rule. If I go back to the IoT interface and look at the rule, the action I defined is not there. Further, I can't add it again because the "CREATE RULE" button is gone.
I also tried to create the rule using the "aws iot create-topic-rule" command but with similar results. Here is the JSON file I used to create the rule:
{
"sql": "SELECT * FROM '+/response/+'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23",
"actions": [{
"lambda": {
"functionArn": "arn:aws:lambda:us-west2:XXX:function:process_mpn_response"
}
}]
}
And here is the output from "aws iot get-topic-rule":
{
"ruleArn": "arn:aws:iot:us-west-2:XXX:rule/ProcessMpnResponse",
"rule": {
"ruleName": "ProcessMpnResponse",
"sql": "SELECT * FROM '+/response/+'",
"actions": [],
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23"
}
}
Note "actions" is an empty list.
Am I missing something or is this feature just broken? Note I am able to configure topic rules that have other actions (e.g. write to dynamodb), just not lambda.
Duane Harkness
Avaliant, LLC