@aws-cdk_integ-tests-alpha.WaiterStateMachine

class WaiterStateMachine (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.IntegTests.Alpha.WaiterStateMachine
Gogithub.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2#WaiterStateMachine
Javasoftware.amazon.awscdk.integtests.alpha.WaiterStateMachine
Pythonaws_cdk.integ_tests_alpha.WaiterStateMachine
TypeScript (source)@aws-cdk/integ-tests-alpha ยป WaiterStateMachine

Implements IConstruct, IDependable

A very simple StateMachine construct highly customized to the provider framework.

This is so that this package does not need to depend on aws-stepfunctions module.

The state machine continuously calls the isCompleteHandler, until it succeeds or times out. The handler is called maxAttempts times with an interval duration and a backoffRate rate.

For example with:

  • maxAttempts = 360 (30 minutes)
  • interval = 5
  • backoffRate = 1 (no backoff)

it will make the API Call every 5 seconds and fail after 360 failures.

If the backoff rate is changed to 2 (for example), it will

  • make the first call
  • wait 5 seconds
  • make the second call
  • wait 15 seconds
  • etc.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as integ_tests_alpha from '@aws-cdk/integ-tests-alpha';
import * as cdk from 'aws-cdk-lib';
const waiterStateMachine = new integ_tests_alpha.WaiterStateMachine(this, 'MyWaiterStateMachine', /* all optional props */ {
  backoffRate: 123,
  interval: cdk.Duration.minutes(30),
  totalTimeout: cdk.Duration.minutes(30),
});

Initializer

new WaiterStateMachine(scope: Construct, id: string, props?: WaiterStateMachineProps)

Parameters

  • scope Construct
  • id string
  • props WaiterStateMachineProps

Construct Props

NameTypeDescription
backoffRate?๐Ÿ”นnumberBackoff between attempts.
interval?๐Ÿ”นDurationThe interval (number of seconds) to wait between attempts.
totalTimeout?๐Ÿ”นDurationThe total time that the state machine will wait for a successful response.

backoffRate?๐Ÿ”น

Type: number (optional, default: 1 (no backoff))

Backoff between attempts.

This is the multiplier by which the retry interval increases after each retry attempt.

By default there is no backoff. Each retry will wait the amount of time specified by interval.


interval?๐Ÿ”น

Type: Duration (optional, default: Duration.seconds(5))

The interval (number of seconds) to wait between attempts.


totalTimeout?๐Ÿ”น

Type: Duration (optional, default: Duration.minutes(30))

The total time that the state machine will wait for a successful response.

Properties

NameTypeDescription
isCompleteProvider๐Ÿ”นAssertionsProviderThe AssertionsProvide that handles async requests.
node๐Ÿ”นNodeThe tree node.
roleArn๐Ÿ”นstringThe IAM Role ARN of the role used by the state machine.
stateMachineArn๐Ÿ”นstringThe ARN of the statemachine.

isCompleteProvider๐Ÿ”น

Type: AssertionsProvider

The AssertionsProvide that handles async requests.


node๐Ÿ”น

Type: Node

The tree node.


roleArn๐Ÿ”น

Type: string

The IAM Role ARN of the role used by the state machine.


stateMachineArn๐Ÿ”น

Type: string

The ARN of the statemachine.

Methods

NameDescription
toString()๐Ÿ”นReturns a string representation of this construct.

toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.