nathanagez / aws-cdk-state-machine-asl

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

Fails out on simple state machines #4

Open alynchos opened 1 year ago

alynchos commented 1 year 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 3 months ago

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

alynchos commented 3 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