feat(iotevents): support timer actions#19949
Conversation
TheRealAmazonKendra
left a comment
There was a problem hiding this comment.
Apologies for our delay in getting to this review. Now that we've moved the branch to v2, can you please take a look at resolving the conflicts and/or opening a new PR for this if resolving them is too messy?
d53da27 to
1af03c9
Compare
Pull request has been modified.
TheRealAmazonKendra
left a comment
There was a problem hiding this comment.
Thanks for your work on this! Overall this looks quite good. Please see my specific feedback inline.
| * | ||
| * @default - none, required if no `durationExpression` is defined. | ||
| */ | ||
| readonly duration?: cdk.Duration; |
There was a problem hiding this comment.
I'm not a fan of mutually exclusive props. I think this should go in the direction of one required prop that gets translated properly into Duration or Expression. Take a look at the model of this we use for Schedule in aws-events.
There was a problem hiding this comment.
Cool! 🤩 I will implement as it. Thank you!
| } | ||
| } | ||
|
|
||
| bind(_scope: Construct, _options: iotevents.ActionBindOptions): iotevents.ActionConfig { |
There was a problem hiding this comment.
| bind(_scope: Construct, _options: iotevents.ActionBindOptions): iotevents.ActionConfig { | |
| public _bind(_scope: Construct, _options: iotevents.ActionBindOptions): iotevents.ActionConfig { |
There was a problem hiding this comment.
This would be better off as it is I think.
This is implementation of IAction and is following Integration in DESIGN_GUIDELINE as same as aws-events target.
There was a problem hiding this comment.
Yeah, I'm annoyed with that but it's not in scope here to ask you to fix an old contract I'm mad at. Maybe I'll get neurotic about it and do some excessive refactoring.
There was a problem hiding this comment.
I've understood that refactoring is necessary even in light of the current implementations.
I'll refactor it!
Pull request has been modified.
| - Set variable to detector instanse | ||
| - Invoke a Lambda function | ||
|
|
||
| ## Use timer |
There was a problem hiding this comment.
Excellent README!
| iotevents.Expression.inputAttribute(input, 'payload.temperature'), | ||
| ), | ||
| ], | ||
| new actions.SetVariableAction( |
| } | ||
| } | ||
|
|
||
| bind(_scope: Construct, _options: iotevents.ActionBindOptions): iotevents.ActionConfig { |
There was a problem hiding this comment.
Yeah, I'm annoyed with that but it's not in scope here to ask you to fix an old contract I'm mad at. Maybe I'll get neurotic about it and do some excessive refactoring.
TheRealAmazonKendra
left a comment
There was a problem hiding this comment.
Looks great!
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This PR is a part of roadmap in #17711. And if this PR is merged, I will close this issue and create some good first issues to implement rest actions and expressions.
This PR supports the timer actions (
SetTimerAction,ResetTimerActionandClearTimerAction) andtimeout()expression.These allow to embed a timer to the state machine of the detector model.
Below figure illustrate the state machine Device Heartbeat. This detector model is used to alert if the message is interrupted for a certain period of time. The integ-test included in this PR is example of creating Device Heartbeat detector model.
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integto deploy the infrastructure and generate the snapshot (i.e.yarn integwithout--dry-run)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license