feat(iotevents): support SetVariable action#19305
Conversation
skinny85
left a comment
There was a problem hiding this comment.
Looks great @yamatatsu, let's just settle on a good name!
| /** | ||
| * The action to create a variable with a specified value. | ||
| */ | ||
| export class IoteventsSetVariableAction implements iotevents.IAction { |
There was a problem hiding this comment.
What's with the weird name? Why the weird Iotevents prefix?
I think this should be called just SetVariableAction.
I could be convinced to IotSetVariableAction or IotEventsSetVariableAction, but in my opinion, the Iot / IotEvents prefix doesn't add anything here.
|
Thank you for contributing! Your pull request will be updated from master 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 master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This PR implememts `SetVariable` actions.
This action allow to set variable to detector instanse.
If use this action as following and deploy it:
```ts
actions: [
new actions.IoteventsSetVariableAction(
'MyVariable',
iotevents.Expression.inputAttribute(input, 'payload.temperature'),
),
],
```
And send message via cli as following:
```
aws iotevents-data batch-put-message --messages=messageId=(date | md5),inputName=test_input,payload=(echo '{"payload":{"deviceId":"000","temperature":18.5}}' | base64)
```
You can see the created detector instanse on web console:

----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR implememts
SetVariableactions.This action allow to set variable to detector instanse.
If use this action as following and deploy it:
And send message via cli as following:
You can see the created detector instanse on web console:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license