Skip to content

feat: support the latest SFN ItemProcessor (replaces Iterator) #536

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

Merged
merged 1 commit into from
Dec 23, 2022
Merged

Conversation

bahrmichael
Copy link
Contributor

@bahrmichael bahrmichael commented Dec 6, 2022

When building a new step function I noticed that what was previously the Iterator has been changed to ItemProcessor. Probably changed with reinvent and their release of Distributed Maps. Here's an example of a state machine that I built with their visual builder and then adjusted to reference my functions: https://github.com/bahrmichael/trade-game-backend/pull/50/commits/9a75d378d7e67673bffc448f5507793c2eb9408e#diff-ea2dbe8c0992878214f1020b0c7ee79668dc63b5c8325a5ed67892d0080a9b27

When setting validate: true I noticed that the plugin expects an Iterator within a Map task, which fails with the new ItemProcessor: https://github.com/bahrmichael/trade-game-backend/actions/runs/3633513042/jobs/6130610217

This PR shows how far I've gotten, but there seems to be another error where I'm not sure if merging this PR already would cause problems for other folks: https://github.com/bahrmichael/trade-game-backend/actions/runs/3633603701/jobs/6130803277

Let me know what you think! I'm not confident that the test is sufficient, please give me a pointer on what it should also test.

@lopburny
Copy link
Contributor

lopburny commented Dec 8, 2022

Hi @bahrmichael Thank you for this PR. Let me take a look just in case and I'll update you soon🙌

@JeffBeltran
Copy link

I ran into this same issue. Thanks @bahrmichael for getting this started.

After a bit more digging, it appears the Iterator state is now deprecated

The ItemProcessor field replaces the now deprecated Iterator field. Although you can continue to include Map states that use the Iterator field, we highly recommend that you replace this field with ItemProcessor

then more info as well

Although you can continue to include Map states that use the following fields, we highly recommend that you replace Iterator with ItemProcessor and Parameters with ItemSelector.

When i generate a new step function i just copy paste the generated code from the aws console. Since they use the newer ItemProcessor by default, I just went and changed it to use the deprecated Iterator key and this fixed the deployment issue on my side.

      "Type": "Map",
      "ItemProcessor": {
        "ProcessorConfig": {
          "Mode": "INLINE"
        },
        "StartAt":...

to

      "Type": "Map",
      "Iterator": {
        "ProcessorConfig": {
          "Mode": "INLINE"
        },
        "StartAt": ....

That being said, it would be nice to get this merged as eventually this workaround will not work

Copy link
Contributor

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you can squash your commits

@bahrmichael
Copy link
Contributor Author

@j0k3r Done! Do you think the tests are sufficient? I'm not sure how I can test this plugin locally.

@j0k3r
Copy link
Contributor

j0k3r commented Dec 19, 2022

@bahrmichael at least it's seems ok to me! :)

@bahrmichael
Copy link
Contributor Author

Awesome! I'll be the first to use it once it's merged :)

@bahrmichael
Copy link
Contributor Author

@lopburny Could I get your eyes on this again?

@lopburny
Copy link
Contributor

Thank you @bahrmichael @j0k3r , All look good to me👍

@lopburny
Copy link
Contributor

🎉 This PR is included in version 3.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

ss-betseqnzr pushed a commit to BetSEQNZR/serverless-step-functions that referenced this pull request Sep 8, 2023
feat: support the latest SFN ItemProcessor (replaces Iterator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants