Learning CDK and Step Functions

I started with this highly useful but slightly outdated tutorial Create a Serverless Workflow.

I rewrote it in cdk.

Read my post on dev.to.

Useful commands

  • npm install do this first
  • npm run lint check your style
  • npm test perform the jest unit tests
  • cdk bootstrap the first time only to prep your environment
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template

Lambdas via SAM

  • cdk synth --no-staging > template.yaml to create the template for SAM.
  • sam local invoke <FN name from template.yaml> -e ./inputs/<JSON input> to run the function locally.