-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(stepfunctions): add support for Jsonata expressions to Map.ItemSelector #34625
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
@@ -120,7 +120,7 @@ export class Map extends MapBase implements INextable { | |||
errors.push('Map state cannot have both an iterator and an item processor'); | |||
} | |||
|
|||
if (this.parameters && this.itemSelector) { | |||
if (this.parameters && (this.itemSelector || this.jsonataItemSelector)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we should also validate that the jsonataItemSelector
string has the correct syntax format: {% <string> %}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue
Closes #34538.
Reason for this change
In the current implementation
itemSelector
must be an object typeMapping[str, Any]
, but Step Functions supports both object mappings and JSONata expressions as strings.See the Amazon States Language specification:
Description of changes
This PR adds a new field
jsonataItemSelector
of typestring
to support this use case. This new field is mutually exclusive withitemSelector
(andparameters
as it is already mutually exclusive withitemSelector
and deprecated).During synthesis, if
jsonataItemSelector
is used, then it will be used to render theItemSelector
in the cloudformation template.I considered creating a class like the ProvideItems class, however this would have been a breaking change for existing users.
Describe any new or updated permissions being added
None.
Description of how you validated changes
Added unit tests and an integration test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license