Cloudformation 模板错误:AWS Step 函数的 CFT 出错

问题描述

我收到以下错误

 Resource handler returned message: "Invalid State Machine DeFinition: 'SCHEMA_VALIDATION_Failed: Value is not a valid resource ARN at /States/aws-lambda1/Resource' (Service: AWsstepFunctions; Status Code: 400; Error Code: InvalidDeFinition; Request ID: 111; Proxy: null)" (RequestToken: 33333,HandlerErrorCode: InvalidRequest)

我有以下 cft 模板,但模板显示有效

{
   "AWstemplateFormatVersion":"2010-09-09","Description":"creating Step Function","Parameters":{
      "stateMachineName":{
         "Type":"String","Description":"State mahcine name"
      },"Myrole":{
         "Type":"String","Description":"The ROle ARN for running the"
      },"TheLogGroupArn":{
         "Type":"String","Description":"The Log Group ARn"
      }
   },"Resources":{
      "TheStepFunctionForAthenaReport":{
         "Type":"AWS::StepFunctions::StateMachine","Properties":{
            "StateMachineName":{
               "Ref":"stateMachineName"
            },"StateMachineType":"STANDARD","RoleArn":{
               "Ref":"Myrole"
            },"LoggingConfiguration":{
               "Destinations":[
                  {
                     "CloudWatchLogsLogGroup":{
                        "LogGroupArn":{
                           "Ref":"TheLogGroupArn"
                        }
                     }
                  }
               ],"IncludeExecutionData":true,"Level":"ALL"
            },"DeFinitionString": {
                    "Fn::Sub": [
                        "{\n  \"Comment\": \"killing Work flow\",\n  \"StartAt\": \"lambdalambda\",\n  \"States\": {\n      \"lambdalambda\": {\n      \"Type\": \"Task\",\n      \"Resource\": \"${lambdaArn}\",\n      \"InputPath\": \"$\",\n      \"ResultPath\": \"$\",\n      \"Catch\": [\n      {\n        \"ErrorEquals\": [\n        \"HandledError\",\n        \"States.TaskFailed\",\n        \"States.Timeout\"\n        ],\n      \"Next\": \"Error Lambda SNS\"\n      }\n    ],\n    \"Next\": \"End killing SNS\"\n    },\n      \"End killing SNS\": {\n         \"Type\": \"Task\",\n         \"Resource\": \"arn:aws:states:::sns:publish\",\n         \"Parameters\": {\n             \"TopicArn\": \"arn:aws:sns:ap-southeast-2:111111:ndWorkflow\",\n             \"Message\": {\n             \"Input\": \"Step Function ended with store data\"\n          }\n      },\n     \"End\": true\n     },\n     \"Error Lambda SNS\": {\n         \"Type\": \"Task\",\n         \"Parameters\": {\n             \"TopicArn\": \"arn:aws:sns:ap-southeast-2:11111111:ErrorLambdaNotification\",\n             \"Message\": {\n             \"Input\": \"\"\n         }\n      },\n      \"End\": true\n      }\n    }\n  }",{
                            "lambdaArn": "arn:aws:sns:ap-southeast-2:11111:ErrorLambdaNotification"
                        }
                    ]
                }
         
    }
    }
    
   }
}

当我手动添加步进函数时,我不知道为什么会出现相同的步进函数定义。但通过 cft 它不起作用

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)