aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.43k stars 591 forks source link

CausePath and ErrorPath can be set, AWS::StepFunctions::StateMachine Definition property with fail state #3525

Closed sudoudaisuke closed 2 months ago

sudoudaisuke commented 2 months ago

CloudFormation Lint Version

1.8.1

What operating system are you using?

docker container based on python:3.12-alpine

Describe the bug

$ cfn-lint ./a.yaml
E3601 Additional properties are not allowed ('CausePath' was unexpected)
b.yaml:11:13

E3601 Additional properties are not allowed ('ErrorPath' was unexpected)
b.yaml:12:13

Expected behavior

Do not report error.

https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-fail-state.html

Reproduction template

Resources:
  MyStateMachine:
    Type: AWS::StepFunctions::StateMachine
    Properties:
      RoleArn: MyStateMachineRole
      Definition:
        StartAt: FailState
        States:
          FailState:
            Type: Fail
            CausePath: $.Cause
            ErrorPath: $.Error

  MyStateMachineRole:
    Type: AWS::IAM::Role
    Properties:
      Path: /
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
          - Effect: Allow
            Principal:
              Service: [ states.amazonaws.com ]
            Action: [ sts:AssumeRole ]