微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。