(aws-stepfunctions): Can't add Jsonata strings to toleratedFailurePercentage
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
When trying to create a DistributedMap with a jsonata string passed in for the toleratedFailurePercentage it is not typesafe and I get a validation error saying that it must be a number that prevents me from generating the definition that I want.
I have tried uploading a jsonata string to the definition body in the aws console so I know its allowed and the doc agree.
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Last Known Working CDK Version
_No response_
### Expected Behavior
I would expect that I am allowed to use a jsonata variable string for the distributed map failure threshold as specified in the doc.
### Current Behavior
```
Error: Validation failed with the following errors:
[.../Map] toleratedFailurePercentage must be between 0 and 100
```
### Reproduction Steps
```
const map = DistributedMap.jsonata(this, 'Map', {
stateName: 'My map',
items: ProvideItems.jsonata(...),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
toleratedFailurePercentage: '{% $myThreshold %}', <<-- This causes a validation error
})
```
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
^2.178.1
### Framework Version
_No response_
### Node.js Version
v20.18.2
### OS
OSX
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start at the DistributedMap.jsonata entry point and trace how toleratedFailurePercentage is validated. Reproduce the TypeScript example with a Jsonata string, then verify that Jsonata expressions are accepted while numeric thresholds still receive the documented validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100