From 3b92169a9b5eacfeaf1b6c37ab9e79f0b4b30bbb Mon Sep 17 00:00:00 2001 From: Diego Santiviago Date: Sat, 14 Aug 2021 23:43:18 -0700 Subject: [PATCH] feat: Add support to States.HeartbeatTimeout --- packages/@aws-cdk/aws-stepfunctions/README.md | 16 ++++++++++++++++ packages/@aws-cdk/aws-stepfunctions/lib/types.ts | 5 +++++ packages/@aws-cdk/aws-stepfunctions/package.json | 1 + 3 files changed, 22 insertions(+) diff --git a/packages/@aws-cdk/aws-stepfunctions/README.md b/packages/@aws-cdk/aws-stepfunctions/README.md index f22d45f9f475d..4faf512ad0509 100644 --- a/packages/@aws-cdk/aws-stepfunctions/README.md +++ b/packages/@aws-cdk/aws-stepfunctions/README.md @@ -555,6 +555,22 @@ new cloudwatch.Alarm(this, 'ThrottledAlarm', { }); ``` +## Error names + +Step Functions identifies errors in the Amazon States Language using case-sensitive strings, known as error names. +The Amazon States Language defines a set of built-in strings that name well-known errors, all beginning with the `States.` prefix. + +* `States.ALL` - A wildcard that matches any known error name. +* `States.Runtime` - An execution failed due to some exception that could not be processed. Often these are caused by errors at runtime, such as attempting to apply InputPath or OutputPath on a null JSON payload. A `States.Runtime` error is not retriable, and will always cause the execution to fail. A retry or catch on `States.ALL` will NOT catch States.Runtime errors. +* `States.DataLimitExceeded` - A States.DataLimitExceeded exception will be thrown for the following: + * When the output of a connector is larger than payload size quota. + * When the output of a state is larger than payload size quota. + * When, after Parameters processing, the input of a state is larger than the payload size quota. + * See [the AWS documentation](https://docs.aws.amazon.com/step-functions/latest/dg/limits-overview.html) to learn more about AWS Step Functions Quotas. +* `States.HeartbeatTimeout` - A Task state failed to send a heartbeat for a period longer than the HeartbeatSeconds value. +* `States.Timeout` - A Task state either ran longer than the TimeoutSeconds value, or failed to send a heartbeat for a period longer than the HeartbeatSeconds value. +* `States.TaskFailed`- A Task state failed during the execution. When used in a retry or catch, `States.TaskFailed` acts as a wildcard that matches any known error name except for `States.Timeout`. + ## Logging Enable logging to CloudWatch by passing a logging configuration with a diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/types.ts b/packages/@aws-cdk/aws-stepfunctions/lib/types.ts index a376ace3b24ea..d3eee929f09b8 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/types.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/types.ts @@ -45,6 +45,11 @@ export class Errors { */ public static readonly ALL = 'States.ALL'; + /** + * A Task State failed to heartbeat for a time longer than the “HeartbeatSeconds” value. + */ + public static readonly HEARTBEAT_TIMEOUT = 'States.HeartbeatTimeout'; + /** * A Task State either ran longer than the “TimeoutSeconds” value, or * failed to heartbeat for a time longer than the “HeartbeatSeconds” value. diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index 485a879fee653..a5141b16bf045 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -105,6 +105,7 @@ "awslint": { "exclude": [ "duration-prop-type:@aws-cdk/aws-stepfunctions.Errors.TIMEOUT", + "duration-prop-type:@aws-cdk/aws-stepfunctions.Errors.HEARTBEAT_TIMEOUT", "no-unused-type:@aws-cdk/aws-stepfunctions.ServiceIntegrationPattern" ] },