DEV Community

Discussion on: CDK ASL Definition Extractor

Collapse
 
emmamoinat profile image
Emma Moinat

Cool, can I see an example of how your step function looks in CDK? We actually do use the ASL to pass into CDK using @matthewbonig/state-machine and it looks something like this:

readonly someProcessingStateMachine = new StateMachine(this, "SomeProcessingStateMachine", {
    definition: JSON.parse(readFileSync(path.join(__dirname, "processing-state-machine-asl.json"), "utf-8").toString()),
    overrides: {
      "Fetch Some Details": {
        Parameters: {
          FunctionName: this.fetchSomeDetails.lambdaFunction.functionArn
        }
      },
      "Save Some Details": {
        Parameters: {
          FunctionName: this.saveSomeDetails.lambdaFunction.functionArn
        }
      }
    }
  });
Enter fullscreen mode Exit fullscreen mode
Collapse
 
benbpyle profile image
Benjamen Pyle

Here are a few in my repos. They are simple but my production workflows are using the same setup with more complicated machines. I've abandoned using ASL in favor of using the CDK Constructs. I love it

Hope this helps

Collapse
 
emmamoinat profile image
Emma Moinat

Awesome thanks, I will take a look!