AWS Step function string/json concatenation

Question:

I have orchestrated a data pipe line using AWS Step function.
In last state I want to send a custom notification. I’m using an Intrinsic function States.Format to format my message and subject. It works fine for Context object element. Here, I have tested that in Message parameter.
But it doesn’t work with input JSON. This is my input JSON
{
“job-param”:{
“pipe-line-name”:”My pipe line name”, “other-keys”:”other values”
}
}

While saving this state machine, it gives me following error message:

The value for the field ‘Subject.$’ must be a valid JSON Path

I checked Input and Result path. They have this value. I can directly use this value as parameter. This is working fine. But I can’t format with other string.

Alternate approach would be to call lambda to customize and trigger SNS. But I want to avoid that.

Can I request some suggestions to fix this error?

Thanks in advance!

Answer:

If you want to use any name with - in your JSON then you can write your JSON Path like this:


But it would be easier if you change your input JSON and replace - with _:

Leave a Reply