Receipt Detector Model actions for AWS IoT Events
Project description
Actions for AWS::IoTEvents Detector Model
---AWS CDK v1 has reached End-of-Support on 2023-06-01. This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see the Migrating to AWS CDK v2 guide.
This library contains integration classes to specify actions of state events of Detector Model in @aws-cdk/aws-iotevents
.
Instances of these classes should be passed to State
defined in @aws-cdk/aws-iotevents
You can define built-in actions to use a timer or set a variable, or send data to other AWS resources.
This library contains integration classes to use a timer or set a variable, or send data to other AWS resources. AWS IoT Events can trigger actions when it detects a specified event or transition event.
Currently supported are:
- Set variable to detector instanse
- Invoke a Lambda function
Set variable to detector instanse
The code snippet below creates an Action that set variable to detector instanse when it is triggered.
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iotevents as iotevents
import aws_cdk.aws_iotevents_actions as actions
# input: iotevents.IInput
state = iotevents.State(
state_name="MyState",
on_enter=[iotevents.Event(
event_name="test-event",
condition=iotevents.Expression.current_input(input),
actions=[actions, [
actions.SetVariableAction("MyVariable",
iotevents.Expression.input_attribute(input, "payload.temperature"))
]
]
)]
)
Invoke a Lambda function
The code snippet below creates an Action that invoke a Lambda function when it is triggered.
import aws_cdk.aws_iotevents as iotevents
import aws_cdk.aws_iotevents_actions as actions
import aws_cdk.aws_lambda as lambda_
# input: iotevents.IInput
# func: lambda.IFunction
state = iotevents.State(
state_name="MyState",
on_enter=[iotevents.Event(
event_name="test-event",
condition=iotevents.Expression.current_input(input),
actions=[actions.LambdaInvokeAction(func)]
)]
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aws-cdk.aws-iotevents-actions-1.204.0.tar.gz
.
File metadata
- Download URL: aws-cdk.aws-iotevents-actions-1.204.0.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47b5cfc032439a0f5ce30e0d91385a99cb388b71720f5094ba7feae2b0925b09 |
|
MD5 | 436977ea5104902e747f0b8b7a0bf233 |
|
BLAKE2b-256 | 0efb71c1b7d3ec578e2bbaf6903cea885a0310f1ae1ab6f53bacc5bb8da4ec68 |
File details
Details for the file aws_cdk.aws_iotevents_actions-1.204.0-py3-none-any.whl
.
File metadata
- Download URL: aws_cdk.aws_iotevents_actions-1.204.0-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8f48b138ce6e1f3e48c3330f1aae6f755e3e2bf34db2c0f1c1854c14be103cd |
|
MD5 | df7f47d57ceba41a6a10cac88ef4f15f |
|
BLAKE2b-256 | dd010d739f1c234d76c032cc6c63168ed45d64b2cfbd23d3ae151234d9ca3f5b |