Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

step_functions: Support new (8/31/2022) intrinsic functions #22629

Closed
2 tasks
dschultz0 opened this issue Oct 24, 2022 · 3 comments · Fixed by #22431
Closed
2 tasks

step_functions: Support new (8/31/2022) intrinsic functions #22629

dschultz0 opened this issue Oct 24, 2022 · 3 comments · Fixed by #22431
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@dschultz0
Copy link

Describe the feature

The Amazon States Language used by Step Functions recently added a number of very useful intrinsic functions that aren't currently supported by the CDK: https://states-language.net/#2022-08-31

  • States.ArrayPartition
  • States.ArrayContains
  • States.ArrayRange
  • States.ArrayGetItem
  • States.ArrayLength
  • States.ArrayUnique
  • States.Base64Encode
  • States.Base64Decode
  • States.Hash
  • States.JsonMerge
  • States.MathRandom
  • States.MathAdd
  • States.StringSplit
  • States.UUID

When we try to use these functions, the CDK (Python variant) returns the following error indicating that the only supported functions are those present before the update:
RuntimeError: Error: JSON path values must be exactly '$', '$$', start with '$.', start with '$$.', start with '$[', or start with an intrinsic function: States.Format, States.StringToJson, States.JsonToString, or States.Array. Received: States.MathAdd($.successful_count, 1)

Use Case

These updates to the States Language are a big step forward in improving the utility of Step Functions, particularly when integrating with a range of AWS services, so it would be incredibly valuable to have them available for inclusion in our workflows.

Proposed Solution

Adding these functions to JsonPath would be useful, although a simple solution would be to add them to the allowed values shown in the error message above so that we can simply use JsonPath.string_at("States.MathAdd($.successful_count, 1)").

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.47.0

Environment details (OS name and version, etc.)

Windows 11 and Amazon Linux

@dschultz0 dschultz0 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2022
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Oct 24, 2022
@kaizencc kaizencc added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Oct 27, 2022
@kaizencc kaizencc removed their assignment Oct 27, 2022
@kaizencc
Copy link
Contributor

#22431 looks to be attempting to add support for this

@mergify mergify bot closed this as completed in #22431 Oct 31, 2022
@mergify mergify bot closed this as completed in 8f85b08 Oct 31, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

1 similar comment
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants