Skip to content

refactor(events): extract shared input validator and IAM role factory#764

Open
VirtueMe wants to merge 1 commit intomasterfrom
refactor/760_events-shared-utils
Open

refactor(events): extract shared input validator and IAM role factory#764
VirtueMe wants to merge 1 commit intomasterfrom
refactor/760_events-shared-utils

Conversation

@VirtueMe
Copy link
Copy Markdown
Collaborator

Closes #760

Summary

  • Add eventUtils.js with validateEventInput (replaces duplicate mutual-exclusivity checks in schedule and cloudwatch compilers) and buildIamRole (replaces duplicate JSON string IAM role templates, parameterised by principal service)
  • Eliminate JSON.parse/stringify round-trips — IAM role is now a plain JS object mutated directly for permissionsBoundary and rolePath

Test plan

  • 10 new eventUtils unit tests pass
  • All 67 existing schedule + cloudwatch event tests pass
  • Full suite passes
  • No changes to plugin configuration or public API

Part of #708

🤖 Generated with Claude Code

- Add lib/deploy/events/eventUtils.js with validateEventInput and buildIamRole
- validateEventInput replaces duplicate if/else Input/InputPath/InputTransformer
  mutual-exclusivity checks in both schedule and cloudwatch event compilers
- buildIamRole replaces duplicate JSON string IAM role templates, parameterised
  by principal service (events.amazonaws.com / scheduler.amazonaws.com)
- Eliminates JSON.parse/stringify dance — IAM role mutations applied directly
- Add 10 unit tests for both utilities

Part of #760

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/serverless-operations/serverless-step-functions@764

commit: 948d055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(events): extract shared input validator and IAM role factory for schedule and CloudWatch events

1 participant