nathanagez / aws-cdk-state-machine-asl

Convert your CDK state machine to an ASL file
26 stars 2 forks source link

Fails out on simple state machines #4

Open alynchos opened 2 years ago

alynchos commented 2 years ago

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)
vidit624 commented 7 months ago

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

alynchos commented 7 months ago

@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