aws-cloudformation / aws-cloudformation-resource-providers-stepfunctions

The CloudFormation Resource Provider Package For AWS Step Functions
https://aws.amazon.com/step-functions/
Apache License 2.0
6 stars 4 forks source link

(AWS::StepFunctions::StateMachine) Allow `YAML` for `DefinitionString` #43

Closed Risae closed 1 year ago

Risae commented 1 year ago

I know that currently Step Functions only support JSON, but it would be awesome if it could support YAML (which will be automatically converted to JSON after deploying the stack if the Step Functions backend needs it this way). Writing Step Function code in YAML is a lot more user-friendly than JSON, especially if you only use YAML for your CloudFormation templates.

wong-a commented 1 year ago

The Definition (assuming you're using a YAML CFN template) and DefintionS3Location properties accept YAML definitions. I encourage you to try those out.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#aws-resource-stepfunctions-statemachine-properties

Example with Definition:

Resources:
  StateMachine:
    Type: AWS::StepFunctions::StateMachine
    Properties:
      Definition:
        StartAt: FirstState
        States:
          FirstState:
            Type: Pass
            Result: 'Hello world'
            End: true

Closing as a wont-fix for DefinitionString