0

I want to assign a variable from one of the state in AWS Step functions. The value of this variable has to be dynamic. I tried various syntax (as suggested in AWS documentation) to achieve this. These are shared below.
"Assign": {
          "index": "$states.input.index", // read inputs from states variable
          "test": "This works fine"
        }

Or

"Assign": {
          "index.$": "$.input.index", // state gets input object in this structure
          "test": "This works fine"
        }

Or

"Assign": {
          "index": "{% $states.input.index %}", // JSONat format
          "test": "This works fine"
        }

None of them seem to work and I end up getting string literal value for the dynamic expression instead of its evaluated value. Can someone help with what am I missing here?

1
  • If you are doing this in the Result of a Pass it will only take hard coded values. If you use the Parameters in a Pass it will take dynamic values. Commented May 6 at 23:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.