Skip to content

Use of Step Function CustomState in CDK #326

@pedramha

Description

@pedramha

❓ Guidance Question

The Question

I would like to know how to define a whole state machine in Amazon State Language and provision it as a resource in CDK using the CustomState construct in CDK.

Environment

  • CDK CLI Version: 1.59.0 (build 1d082f4)
  • Example: stepfunctions-job-poller
  • Example Version: 207
  • OS: Windows 10
  • Language: TypeScript

Other information

Something like:

const stateJson = {
     "Comment": "A Hello World example of the Amazon States Language using Pass states",
     "StartAt": "Hello",
     "States": {
       "Hello": {
         "Type": "Pass",
         "Result": "Hello",
         "Next": "World"
       },
       "World": {
         "Type": "Pass",
         "Result": "World",
         "End": true
       }
     }
   };
   const custom = new sfn.CustomState(this, 'my custom task', {
     stateJson,
   });
   //maybe I should use something else than the chain construct?
   const definition = sfn.Chain.start(custom);
   new sfn.StateMachine(this, 'my state machine', {
     definition
   });

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions