Amazon web services Cloudformation Templete错误:AWS Step函数的CFT出现错误
我得到了下面的错误Amazon web services Cloudformation Templete错误:AWS Step函数的CFT出现错误,amazon-web-services,amazon-cloudformation,Amazon Web Services,Amazon Cloudformation,我得到了下面的错误 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: InvalidDefin
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 \"Resource\": \"arn:aws:states:::sns:publish\",\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"
}
]
}
}
}
}
}
我不知道为什么当我手动添加step函数时,相同的step函数定义正在工作。但是通过cft它不起作用您使用的是SNS arn,但在您的示例中称为lambdaARN,您的意思是向SNS发布某些内容,还是要调用lambda函数?这就是为什么它说您的arn不正确,因为它不是lambda arn