class TimerDuration
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IoTEvents.Actions.Alpha.TimerDuration |
Go | github.com/aws/aws-cdk-go/awscdkioteventsactionsalpha/v2#TimerDuration |
Java | software.amazon.awscdk.services.iotevents.actions.alpha.TimerDuration |
Python | aws_cdk.aws_iotevents_actions_alpha.TimerDuration |
TypeScript (source) | @aws-cdk/aws-iotevents-actions-alpha » TimerDuration |
The duration of the timer.
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.SetTimerAction('MyTimer', {
duration: cdk.Duration.seconds(60),
}),
],
}],
});
Initializer
new TimerDuration()
Methods
Name | Description |
---|---|
static from | Create a timer-duration from Duration. |
static from | Create a timer-duration from Expression. |
Duration(duration)
static frompublic static fromDuration(duration: Duration): TimerDuration
Parameters
- duration
Duration
Returns
Create a timer-duration from Duration.
The range of the duration is 60-31622400 seconds. The evaluated result of the duration expression is rounded down to the nearest whole number. For example, if you set the timer to 60.99 seconds, the evaluated result of the duration expression is 60 seconds.
Expression(expression)
static frompublic static fromExpression(expression: Expression): TimerDuration
Parameters
- expression
Expression
Returns
Create a timer-duration from Expression.
You can use a string expression that includes numbers, variables ($variable.<variable-name>), and input values ($input.<input-name>.<path-to-datum>) as the duration.
The range of the duration is 60-31622400 seconds. The evaluated result of the duration expression is rounded down to the nearest whole number. For example, if you set the timer to 60.99 seconds, the evaluated result of the duration expression is 60 seconds.