1.204.0 • Published 11 months ago

@aws-cdk/aws-iotevents-actions v1.204.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

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.

doc: https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html


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.

import * as iotevents from '@aws-cdk/aws-iotevents';
import * as actions from '@aws-cdk/aws-iotevents-actions';

declare const input: iotevents.IInput;

const state = new iotevents.State({
  stateName: 'MyState',
  onEnter: [{
    eventName: 'test-event',
    condition: iotevents.Expression.currentInput(input),
    actions: [
      actions: [
        new actions.SetVariableAction(
          'MyVariable',
          iotevents.Expression.inputAttribute(input, 'payload.temperature'),
        ),
      ],
    ],
  }],
});

Invoke a Lambda function

The code snippet below creates an Action that invoke a Lambda function when it is triggered.

import * as iotevents from '@aws-cdk/aws-iotevents';
import * as actions from '@aws-cdk/aws-iotevents-actions';
import * as lambda from '@aws-cdk/aws-lambda';

declare const input: iotevents.IInput;
declare const func: lambda.IFunction;

const state = new iotevents.State({
  stateName: 'MyState',
  onEnter: [{
    eventName: 'test-event',
    condition: iotevents.Expression.currentInput(input),
    actions: [new actions.LambdaInvokeAction(func)],
  }],
});
1.203.0

12 months ago

1.204.0

11 months ago

1.201.0

1 year ago

1.199.0

1 year ago

1.202.0

12 months ago

1.200.0

1 year ago

1.195.0

1 year ago

1.193.0

1 year ago

1.197.0

1 year ago

1.192.0

1 year ago

1.196.0

1 year ago

1.194.0

1 year ago

1.198.1

1 year ago

1.198.0

1 year ago

1.185.0

1 year ago

1.189.0

1 year ago

1.187.0

1 year ago

1.191.0

1 year ago

1.188.0

1 year ago

1.186.0

1 year ago

1.186.1

1 year ago

1.190.0

1 year ago

1.181.0

1 year ago

1.183.0

1 year ago

1.181.1

1 year ago

1.178.0

2 years ago

1.180.0

2 years ago

1.184.0

1 year ago

1.184.1

1 year ago

1.182.0

1 year ago

1.177.0

2 years ago

1.179.0

2 years ago

1.176.0

2 years ago

1.175.0

2 years ago

1.169.0

2 years ago

1.170.0

2 years ago

1.174.0

2 years ago

1.173.0

2 years ago

1.172.0

2 years ago

1.171.0

2 years ago

1.170.1

2 years ago

1.163.0

2 years ago

1.162.0

2 years ago

1.161.0

2 years ago

1.160.0

2 years ago

1.167.0

2 years ago

1.166.1

2 years ago

1.165.0

2 years ago

1.163.2

2 years ago

1.164.0

2 years ago

1.163.1

2 years ago

1.168.0

2 years ago

1.158.0

2 years ago

1.159.0

2 years ago

1.154.0

2 years ago

1.155.0

2 years ago

1.156.0

2 years ago

1.157.0

2 years ago

1.156.1

2 years ago

1.153.0

2 years ago

1.153.1

2 years ago

1.150.0

2 years ago

1.151.0

2 years ago

1.152.0

2 years ago

1.148.0

2 years ago

1.149.0

2 years ago

1.146.0

2 years ago

1.147.0

2 years ago

1.145.0

2 years ago