Skip to content

Feature Request: AWS::StepFunctions::StateMachine - Recognize if state is unreachable #4073

@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 a 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: Pass One
        States:
          Pass One:
            Type: Pass
            Next: Pass Two
          Pass Two:
            Type: Pass
            Next: Success
          Unreachable pass: # <-------------------------- This state is unreachable
            Type: Pass
            Next: Success
          Success:
            Type: Succeed

CloudFormation error:

Resource handler returned message:
"Invalid State Machine Definition: 'MISSING_TRANSITION_TARGET: State "Unreachable pass" is not reachable.
at /States/Unreachable pass' (Service: Sfn, Status Code: 400, Request ID: e...f)
(SDK Attempt Count: 1)"
(RequestToken: 6...f8, 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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions