Skip to content

stepfunctions: Retry block in CustomState is always empty. #28586

Closed
@troter

Description

Describe the bug

After this(#28422) changes, Retry block in CustomState is always empty.

because Retry is always overwritten here.

https://github.com/graydenshand/aws-cdk/blob/3e7c777f28d3375acdb6bf1446c2cd159eadce6d/packages/aws-cdk-lib/aws-stepfunctions/lib/states/custom-state.ts#L56-L65

Expected Behavior

  • The Retry block passed to the constructor will be used as is.
  • or add addRetry method.

Current Behavior

Retry is always overwrite by empty array.

Reproduction Steps

Pass stateJson that has Retry lock to CustomState.

const stateJson = {
    Type: "Task",
    Resource: "arn:aws:states:::ecs:runTask.sync",
    ResultPath: "$.results.ECSRunTask",
    TimeoutSeconds: defaultTimeoutHours * 60 * 60,
    Retry: [
        {
            ErrorEquals: ["ECS.AmazonECSException", "ECS.ServerException"],
            IntervalSeconds: 60,
            MaxAttempts: 3,
        },
    ],
    Parameters: {
        LaunchType: "FARGATE",
        Group: ecsServiceName,
        Cluster: clusterArn,
        TaskDefinition: taskDefinitionArn,
    },
};

const RunTaskState = new sfn.CustomState(this, "ECS RunTask.", {
    stateJson: stateJson,
});

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.116.0

Framework Version

No response

Node.js Version

18.15.0

OS

macOS Sonoma 14.2.1

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsbugThis issue is a bug.effort/mediumMedium work item – several days of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions