aws-cdk-state-machine-asl icon indicating copy to clipboard operation
aws-cdk-state-machine-asl copied to clipboard

Fails out on simple state machines

Open alynchos opened this issue 2 years ago • 2 comments

If a state machine is filled with simple Pass states, cdk synthesizes it into a definition string already. When this occurs, this code breaks the entire process.

const [delimiter, values] = expression;
                                ^

TypeError: expression is not iterable

A simple fix I made locally to bypass this is:

    const nestedDefinitionString = definition["Fn::Join"];
    if (!nestedDefinitionString) {
      console.log("In definition string format, skipping asl generation...")
      return;
    }
    const asl = fnJoin(nestedDefinitionString)

alynchos avatar Aug 16 '22 21:08 alynchos

@alynchos can you tell where did you make this fix to resolve the error?

vidit624 avatar Apr 04 '24 11:04 vidit624

@alynchos can you tell where did you make this fix to resolve the error?

I made a local fork and added that code here: https://github.com/nathanagez/aws-cdk-state-machine-asl/blob/main/index.js#L15

alynchos avatar Apr 04 '24 21:04 alynchos