'Invoking AWS Step Function from Lambda Fails Silently in Serverless 3

I was able to start a state machine from a lambda in Serverless v2 using this technique:

    const request = {
        data: someDataGoesHere
    };
    const params = {
        stateMachineArn: process.env.statemachine_arn,
        input: JSON.stringify(request),
        name: uniqueNameGoesHere,
    };
    const steps = new SFNClient({region: "us-east-1"});
    const command = new StartSyncExecutionCommand(params);
    console.log("Starting State Machine", params);
    const result = await steps.send(command);
    console.log("Back from State Machine", result);

After upgrading Serverless Framework to version 3, this code fails silently - the call to steps.send(command) never returns and the lambda times out (so "Back from State Machine" is never written to the lambda's log). An entry is not created in the CloudWatch logs for the step function, so there doesn't appear to be any way to figure out what went wrong. I have verified that stateMachineArn is set correctly.

I have tried removing and re-deploying the entire stack, but still can't start the step function. Any debugging advice would be appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source