UNPKG

1.37 kBTypeScriptView Raw
1import { Grant, IGrantable } from '@aws-cdk/aws-iam';
2import { IFunction } from '@aws-cdk/aws-lambda';
3import { Duration } from '@aws-cdk/core';
4import { Construct } from '@aws-cdk/core';
5export interface WaiterStateMachineProps {
6 /**
7 * The main handler that notifies if the waiter to decide 'complete' or 'incomplete'.
8 */
9 readonly isCompleteHandler: IFunction;
10 /**
11 * The handler to call if the waiter times out and is incomplete.
12 */
13 readonly timeoutHandler: IFunction;
14 /**
15 * The interval to wait between attempts.
16 */
17 readonly interval: Duration;
18 /**
19 * Number of attempts.
20 */
21 readonly maxAttempts: number;
22 /**
23 * Backoff between attempts.
24 */
25 readonly backoffRate: number;
26}
27/**
28 * A very simple StateMachine construct highly customized to the provider framework.
29 * This is so that this package does not need to depend on aws-stepfunctions module.
30 *
31 * The state machine continuously calls the isCompleteHandler, until it succeeds or times out.
32 * The handler is called `maxAttempts` times with an `interval` duration and a `backoffRate` rate.
33 */
34export declare class WaiterStateMachine extends Construct {
35 readonly stateMachineArn: string;
36 constructor(scope: Construct, id: string, props: WaiterStateMachineProps);
37 grantStartExecution(identity: IGrantable): Grant;
38}