.StartExecution 不是函数
.StartExecution is not a function
我创建了一个 lambda(到目前为止还不错)。
规格:
- 可以访问 stepfunctions
- 运行流畅
- 版本:Node.js14.x
但是当我尝试像这样从我的 lambda 调用步进函数时:
var AWS = require("aws-sdk");
var stepfunctions = new AWS.StepFunctions({apiVersion: '2016-11-23'});
const params = {
"input": "{}",
"name": srcKey,
"stateMachineArn": process.env.STATE_MACHINE_ARN
};
return stepfunctions.StartExecution(params);
我收到以下错误:
Response
{
"errorType": "TypeError",
"errorMessage": "stepfunctions.StartExecution is not a function",
"trace": [
"TypeError: stepfunctions.StartExecution is not a function",
" at /var/task/index.js:119:26",
" at wrapper (/var/task/node_modules/async/dist/async.js:273:20)",
" at Response.next (/var/task/node_modules/async/dist/async.js:4585:24)",
" at Response.<anonymous> (/var/task/node_modules/async/dist/async.js:326:20)",
" at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:369:18)",
" at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
" at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
" at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:688:14)",
" at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
" at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)"
]
}
哪个对我来说没有意义?
如果我看到这个文档:
https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html
甚至这个:
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#constructor-property
那里应该有这个功能。
我错过了什么/做错了什么?
谢谢!
你打错了...是小写 s
:
startExecution
对比 StartExecution
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#startExecution-property
我创建了一个 lambda(到目前为止还不错)。
规格:
- 可以访问 stepfunctions
- 运行流畅
- 版本:Node.js14.x
但是当我尝试像这样从我的 lambda 调用步进函数时:
var AWS = require("aws-sdk");
var stepfunctions = new AWS.StepFunctions({apiVersion: '2016-11-23'});
const params = {
"input": "{}",
"name": srcKey,
"stateMachineArn": process.env.STATE_MACHINE_ARN
};
return stepfunctions.StartExecution(params);
我收到以下错误:
Response { "errorType": "TypeError", "errorMessage": "stepfunctions.StartExecution is not a function", "trace": [ "TypeError: stepfunctions.StartExecution is not a function", " at /var/task/index.js:119:26", " at wrapper (/var/task/node_modules/async/dist/async.js:273:20)", " at Response.next (/var/task/node_modules/async/dist/async.js:4585:24)", " at Response.<anonymous> (/var/task/node_modules/async/dist/async.js:326:20)", " at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:369:18)", " at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)", " at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)", " at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:688:14)", " at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)", " at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)" ] }
哪个对我来说没有意义?
如果我看到这个文档: https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html 甚至这个: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#constructor-property
那里应该有这个功能。
我错过了什么/做错了什么?
谢谢!
你打错了...是小写 s
:
startExecution
对比 StartExecution
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#startExecution-property