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

class TimerDuration ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.IoTEvents.Actions.Alpha.TimerDuration
Gogithub.com/aws/aws-cdk-go/awscdkioteventsactionsalpha/v2#TimerDuration
Javasoftware.amazon.awscdk.services.iotevents.actions.alpha.TimerDuration
Pythonaws_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

NameDescription
static fromDuration(duration)๐Ÿ”นCreate a timer-duration from Duration.
static fromExpression(expression)๐Ÿ”นCreate a timer-duration from Expression.

static fromDuration(duration)๐Ÿ”น

public static fromDuration(duration: Duration): TimerDuration

Parameters

  • duration Duration

Returns

  • TimerDuration

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.


static fromExpression(expression)๐Ÿ”น

public static fromExpression(expression: Expression): TimerDuration

Parameters

  • expression Expression

Returns

  • TimerDuration

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.