@aws-cdk_aws-iotevents-actions-alpha.SetVariableAction

class SetVariableAction 🔹

LanguageType name
.NETAmazon.CDK.AWS.IoTEvents.Actions.Alpha.SetVariableAction
Gogithub.com/aws/aws-cdk-go/awscdkioteventsactionsalpha/v2#SetVariableAction
Javasoftware.amazon.awscdk.services.iotevents.actions.alpha.SetVariableAction
Pythonaws_cdk.aws_iotevents_actions_alpha.SetVariableAction
TypeScript (source)@aws-cdk/aws-iotevents-actions-alpha » SetVariableAction

Implements IAction

The action to create a variable with a specified value.

Example

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

declare const input: iotevents.IInput;

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

Initializer

new SetVariableAction(variableName: string, value: Expression)

Parameters

  • variableName string — the name of the variable.
  • value Expression — the new value of the variable.