我正在尝试从 Node.js lambda 函数调用步骤函数。我尝试了该线程的解决方案并更新了实现。
显示错误响应的解决方案,但更新后的代码显示成功响应。但更新后的代码没有调用step函数。
我的代码:
console.log('Loading function');
const AWS = require('aws-sdk');
exports.handler = function(event, context) {
console.log('Loading step functions');
const stepFunctions = new AWS.StepFunctions({
region: 'us-east-2'
});
console.log('Loading init');
module.exports.init = (event, context, callback) => {
console.log('Loading params');
const params = {
stateMachineArn: 'ARN of My State Machine',
// input: JSON.stringify({}), Optional if your statemachine requires an application/json input, make sure its stringified
name: 'TestExecution' // name can be anything you want, but it should change for …Run Code Online (Sandbox Code Playgroud)