gpt4 book ai didi

amazon-web-services - 如何在AWS Step Functions中使用数组内部的jsonPath

转载 作者:行者123 更新时间:2023-12-03 15:40:46 25 4
gpt4 key购买 nike

我正在编写一个AWS步骤函数,对于其中一个步骤,我希望调用一个接受数组作为输入之一的lambda。但是,如果我尝试将JsonPath传递到数组中,则会得到

The value for the field 'arrayField.$' must be a STRING that contains a JSONPath but was an ARRAY

我的步进函数定义:
{
"StartAt": "First",
"States": {
"First": {
"Type": "Pass",
"Parameters": {
"type": "person"
},
"ResultPath": "$.output",
"Next": "Second"
},
"Second": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:<aws_id>:function:MyFunction",
"Parameters": {
"regularParameter": "some string",
"arrayParameter.$": ["$.output.type"]
},
"Next": "Succeed"
},
"Succeed": {
"Type": "Succeed"
}
}
}

如何在数组内使用jsonPath?

最佳答案

从新发行版开始,您可以使用内部函数States.Array:

  "arrayParameter.$": "States.Array($.output.type)"
https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html

关于amazon-web-services - 如何在AWS Step Functions中使用数组内部的jsonPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59167287/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com