Possible to have a single parameter receive its value conditionally?

0

I have a parameter 'request_id' that I want to have get an ID from two different formats of JSON that get sent to the input of my step function task.

The first form looks like this:

{ "request_id": "abcde-abcd-abcde-abc" }

The second is in this form:

{ "request": { "id": "abcde-abcd-abcde-abc", }

Currently, I have a parameter which looks like

"request_id.$": "$.request_id"

but would like something that is equivalent to (this one does not work)

"request_id.$": "$.['request_id','request.id']"

The step function task looks like this

"Processing Error": {
              "Type": "Task",
              "Resource": "${UpdateRequestStatus.Arn}",
              "Parameters": {
                "status": "ERROR",
                "status_reason": "Failed to process data.",
                "domain_name.$": "$.domain_name",
                "client_id.$": "$.client_id",
                *"request_id.$": "$.request_id"*
              },
              "Next": "Processing Failed"

Is this possible within the step function or will I need to either split those two request id's up into two paths in my JSON or do it in a function?

質問済み 3年前205ビュー
1回答
0

Hello,

I believe this capability is not possible through JsonPath.
I would suggest you normalize the input data to the state OR as you mentioned, possibly have a state prior to the task state that will handle these 2 conditions and normalize it before it reaches the task state.

AWS
回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ