@aws-cdk/aws-iot: Add an option for CfnTopicRule to automatically create CfnPermission to invoke Lambda Function #16339
Labels
@aws-cdk/aws-iot
Related to AWS IoT
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
in-progress
This issue is being actively worked on.
p1
When creating a TopicRule that should call a AWS Lambda, all the resources are correctly created without error.
However the lambda function is never invoked. On the AWS console, when going into the created topic rule, click edit and then just update is enough to "fix" the problem:
After a lot of digging, a
CfnPermission
appear to be needed for the lambda function to be invoked. The error is otherwise not surfaced to the end user. This problem was faced already and logged here for example: #12772But because of the absence of error, the source of the problem could not be identified, even by the CDK team. This is of course not a CDK bug though, one would face the same problem using Cloudformation.
Proposed Solution
As CDK's main role and philosophy is to ship with sensible default, I would suggest to have an option when creating a
CfnTopicRule
which would automatically create the rightCfnPermission
under the hood.E.g, something like this (a
withCfnPermission
attribute):Thanks a lot for consideration and for the great work!
The text was updated successfully, but these errors were encountered: