fix(iam): support intrinsic functions as StateMachineArn in JSONata Arguments#706
Closed
VirtueMe wants to merge 1 commit intoserverless-operations:masterfrom
Closed
Conversation
…rguments When using JSONata query language, StateMachineArn in Arguments can be an intrinsic function object (Ref, Fn::GetAtt) instead of a string. Guard the .trim() call with a typeof check so it is only applied to strings, and treat non-string values as literal ARN references. Fixes serverless-operations#704 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
commit: |
This was referenced Mar 20, 2026
Collaborator
|
This was fixed earlier by #709 Please let me know if it can be closed or needs to be revised |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TypeError: state.Arguments.StateMachineArn.trim is not a functioncrash whenStateMachineArnin a JSONataArgumentsblock is an intrinsic function object (!Ref,!GetAtt) rather than a plain string.trim()call with atypeofstring check; non-string values are passed through as-is to the IAM policy resourceTest plan
RefandFn::GetAttasStateMachineArnin JSONataArguments— verifies the correct ARN object is used as the IAM resourceFixes #704
🤖 Generated with Claude Code