Skip to content

Feature Request: AWS::StepFunctions::StateMachine - Recognize if StartAt is unreachable #4074

@r-heimann

Description

@r-heimann

Is this feature request related to a new rule or cfn-lint capabilities?

New capability

Describe the feature you'd like to request

Currently cfn-lint is unable to recognize if the "StartAt" state is unreachable. The following CloudFormation Template will cause a CloudFormation error:

AWSTemplateFormatVersion: 2010-09-09
Description: Test

Resources:
  StepFunctionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Effect: Allow
            Principal:
              Service: states.amazonaws.com
            Action: sts:AssumeRole

  StateMachine:
    Type: AWS::StepFunctions::StateMachine
    Properties:
      RoleArn: !GetAtt StepFunctionRole.Arn
      Definition:
        StartAt: Not sure # <-------------- State doesn't exist
        States:
          Pass One:
            Type: Pass
            Next: Success
          Success:
            Type: Succeed

CloudFormation error:

Resource handler returned message:
"Invalid State Machine Definition:
'MISSING_TRANSITION_TARGET: Missing 'Next' target: Not sure at /StartAt,
MISSING_TRANSITION_TARGET: State "Pass One" is not reachable. at /States/Pass One'
(Service: Sfn, Status Code: 400, Request ID: 4...8) (SDK Attempt Count: 1)"
(RequestToken: 0...9, HandlerErrorCode: InvalidRequest)

It would be great if cfn-lint could give an error on these.

Describe the solution you'd like

A new/updated rule to notify the user of this error.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions