显然,我不能让RequestTemplates为空,因为它包含关于要调用的状态机的信息。URI本身不包含这些信息,但它只指向状态机API的入口点。
正确的方法来自
this documentation's page
。
状态机API公开了各种方法。执行Step函数的是“StartExecution”。这样形成的物体必须通过入口点
{
"input": "string",
"name": "string",
"stateMachineArn": "string"
}
因此,在云形成中:
"Integration": {
"Type": "AWS",
"IntegrationHttpMethod": "POST",
"Uri": {
"Fn::Join": ["",
["arn:aws:apigateway:",
{
"Ref": "AWS::Region"
},
":states:action/StartExecution"]]
},
"RequestTemplates": {
"application/json": {
"Fn::Sub": ["{\"input\": \"$util.escapeJavaScript($input.json('$'))\",\"stateMachineArn\": \"${arn}\"}",
{
"arn": {
"Ref": "[StepMachineResourceName]"
}
}]
}
}
}