Skip to main content

Receipt Detector Model actions for AWS IoT Events

Project description

Actions for AWS::IoTEvents Detector Model

---

End-of-Support

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-cdk.aws-iotevents-actions-1.204.0.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file aws-cdk.aws-iotevents-actions-1.204.0.tar.gz.

File metadata

File hashes

Hashes for aws-cdk.aws-iotevents-actions-1.204.0.tar.gz
Algorithm Hash digest
SHA256 47b5cfc032439a0f5ce30e0d91385a99cb388b71720f5094ba7feae2b0925b09
MD5 436977ea5104902e747f0b8b7a0bf233
BLAKE2b-256 0efb71c1b7d3ec578e2bbaf6903cea885a0310f1ae1ab6f53bacc5bb8da4ec68

See more details on using hashes here.

File details

Details for the file aws_cdk.aws_iotevents_actions-1.204.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_cdk.aws_iotevents_actions-1.204.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f48b138ce6e1f3e48c3330f1aae6f755e3e2bf34db2c0f1c1854c14be103cd
MD5 df7f47d57ceba41a6a10cac88ef4f15f
BLAKE2b-256 dd010d739f1c234d76c032cc6c63168ed45d64b2cfbd23d3ae151234d9ca3f5b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page