-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support lambda actions for IoT topic rules #5420
Comments
As you've noted, using Lambda's This issue is not a bug, but a feature gap. Ideally, we would have a way to configure a lambda function, dynamo table or SNS topic directly into an IoT rule as an action. Unfortunately, we don't yet have full support of IoT in the CDK, and only support If this was built out, it would be modeled as a secondary module of IoT, named something like const fn = new lambda.Function(this, 'myfunction', { ... });
const rule = new iot.Rule(this, 'myrule', { ... });
rule.addAction(new LambdaAction({
handler: fn,
...
})); The @shivlaks - does this seem reasonable to you? Would you consider this a gap with the IoT construct library support? |
How to implement the same using Java ? |
I've the same problem in Java ``
`` Step to reproduce
|
This is resolved by #17110 😃 |
|
Very similar to #555
There does not appear to be an automatic way to add permissions (the "Function Policy") to the Lambda which is invoked from an IoT Topic Rule.
I obviously was not expecting the below to work since there is no explicit link between the IoT rule and the Lambda (since IoT does not appear to be supported by
lambda-event-sources
)Upon "editing" the IoT rule through the console, AWS helpfully says "we'll handle the Lambda permissions for you" - would be nice if this happened through the CDK
Reproduction Steps
Error Log
The IoT rule does NOT trigger the lambda and, in fact, I don't think the rule triggers at all (no error is logged in the verbose IoT logs in CloudWatch)
Environment
Other
Removing the policy
Current approach
My current approach (which I can confirm does work)
Everything as above and append:
It's unclear if this is the suggested fix (because IoT has notoriously never had a huge amount of documentation) but its working. Still, would be nice if IoT worked in the same way as almost every other Lambda event trigger
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: