aws / aws/aws-cdk

(stepfunctions): use Definition instead of DefinitionString

Open
#18,880 6 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/aws-stepfunctions effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Description

When generating the CloudFormation template for an AWS::StepFunctions::StateMachine, use the Definition field not DefinitionString.

### Use Case

When things change in the step function definition, using DefinitionString leads to a completely inscrutable CDK diff. For example, while switching from `Task` to `LambdaInvoke`, some fields in the JSON were reordered, and we got a cdk diff that we weren't expecting and was not at all human readable.

### Proposed Solution

Never use DefinitionString. Always use Definition. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definition

### Other information

_No response_

### Acknowledge

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start by locating the AWS::StepFunctions::StateMachine synthesis entry point in the AWS CDK TypeScript code and its existing tests. Trace how the state machine definition is serialized, then verify the generated CloudFormation template uses Definition and that the relevant diff or snapshot tests remain readable.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.