(aws-stepfunctions): `DistributedMap` prop `resultWriter` doesn't work when integrating with StateMachine
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
`DistributedMap` prop `resultWriter` seems like never works with StateMachine, while `resultWriterV2` does.
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Last Known Working CDK Library Version
_No response_
### Expected Behavior
`resultWriter` prop should be deprecated or at least works for old features.
### Current Behavior
When using `resultWriter` with StateMachine, SM's DefinitionString doesn't have any `ResultWriter`.
### Reproduction Steps
Check this integration https://github.com/aws/aws-cdk/blob/2cdfc8a909ce3752833e46dd2ed0106fee0e785a/packages/%40aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.distribution-map-with-result-writer-jsonata.ts#L26-L29
Its snapshot template confirms the issue, DefinitionString doesn't have any `ResultWriter`, https://github.com/aws/aws-cdk/blob/2cdfc8a909ce3752833e46dd2ed0106fee0e785a/packages/%40aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.distribution-map-with-result-writer-jsonata.js.snapshot/aws-stepfunctions-map-with-result-writer.template.json#L201-L216
Run the integration `yarn integ test/aws-stepfunctions/test/integ.distribution-map-with-result-writer-jsonata.js --force --no-clean`, we will see nothing is output to the result bucket.
### Possible Solution
Deprecate `resultWriter` prop as `resultWriterV2` works fine. As we already deprecated `ResultWriter` class, I think we should do the same for the prop.
### Additional Information/Context
_No response_
### AWS CDK Library version (aws-cdk-lib)
main
### AWS CDK CLI version
all
### Node.js Version
all
### OS
all
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start with the integration in test/aws-stepfunctions/test/integ.distribution-map-with-result-writer-jsonata.ts and compare its generated DefinitionString with the snapshot at test/aws-stepfunctions/test/integ.distribution-map-with-result-writer-jsonata.js.snapshot/aws-stepfunctions-map-with-result-writer.template.json. Run the documented integration command to reproduce the missing ResultWriter output. Done means the resultWriter behavior is corrected or the prop is explicitly deprecated, with the integration output and snapshot reflecting the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100