class SetVariableAction
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.IoTEvents.Actions.SetVariableAction |
![]() | software.amazon.awscdk.services.iotevents.actions.SetVariableAction |
![]() | aws_cdk.aws_iotevents_actions.SetVariableAction |
![]() | @aws-cdk/aws-iotevents-actions » SetVariableAction |
Implements
IAction
The action to create a variable with a specified value.
Example
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'),
),
],
],
}],
});
Initializer
new SetVariableAction(variableName: string, value: Expression)
Parameters
- variableName
string
— the name of the variable. - value
Expression
— the new value of the variable.
Methods
Name | Description |
---|---|
bind(_scope, _options) | Returns the AWS IoT Events action specification. |
bind(_scope, _options)
public bind(_scope: Construct, _options: ActionBindOptions): ActionConfig
Parameters
- _scope
Construct
- _options
Action
Bind Options
Returns
Returns the AWS IoT Events action specification.