简体   繁体   English

StepFunctionsLocal 不接受 $$ 参数

[英]StepFunctionsLocal does not accept $$ parameter

As documented here , the AWS state machine definition syntax allows access to attributes from the higher scope within a map state iteration with $$.Map.Item.Value :如此所述,AWS state 机器定义语法允许使用$$.Map.Item.Value访问 map state 迭代中更高 scope 的属性:

{
  "StartAt": "ExampleMapState",
  "States": {
    "ExampleMapState": {
      "Type": "Map",
      "Parameters": {
               "ContextValue.$": "$$.Map.Item.Value"
             },
      "Iterator": {
         "StartAt": "TestPass",
         "States": {
           "TestPass": {
             "Type": "Pass",    
             "End": true
           }
         }
      },
      "End": true
    }
  }
} 

However, when run with the StepFunctionsLocal (both Java and Docker versions) this example definition itself raises SCHEMA_VALIDATION_FAILED error:但是,当使用 StepFunctionsLocal(Java 和 Docker 版本)运行时,此示例定义本身会引发 SCHEMA_VALIDATION_FAILED 错误:

SCHEMA_VALIDATION_FAILED: The value for the field 'ContextValue.$' must be a valid JSONPath or a valid intrinsic function call at /States/ExampleMapState/Parameters

Am I missing something or is this a bug in the StepFunctionsLocal?我是否遗漏了什么或者这是 StepFunctionsLocal 中的错误?

检查您的脚本以确保您已正确转义双 $$

After some tests, my best guess is that it's a bug in the aws cli (or a scaping issue when declaring the sfn definition, as stated here , though I wasn't able to do it).经过一些测试后,我最好的猜测是它是aws cli 中的一个错误(或者声明sfn定义时的一个转义问题,如此处所述,尽管我无法做到这一点)。

Anyway, I tried boto3 instead of the cli using this example definition.无论如何,我使用这个示例定义尝试boto3而不是cli

>>> definition = """
... {
...   "Comment": "Accessing context object in a state machine",
...   "StartAt": "Get execution context data",
...   "States": {
...     "Get execution context data": {
...       "Type": "Pass",
...       "Parameters": {
...         "startTime.$": "$$.Execution.StartTime",
...         "execName.$": "$$.Execution.Name"
...       },
...       "ResultPath": "$.executionContext",
...       "End": true
...     }
...   }
... }"""
>>> role = "arn:aws:iam::012345678901:role/DummyRole"
>>> r = client.create_state_machine(name="Test", definition=definition, roleArn=role)
>>> pprint.pprint(r)
{'ResponseMetadata': {'HTTPHeaders': {'content-length': '161',
                                      'date': 'Fri, 30 Dec 2022 19:46:31 GMT',
                                      'server': 'Jetty(9.4.43.v20210629)'},
                      'HTTPStatusCode': 200,
                      'RetryAttempts': 0},
 'creationDate': datetime.datetime(2022, 12, 30, 14, 46, 31, 770000, tzinfo=tzlocal()),
 'stateMachineArn': 'arn:aws:states:us-west-2:123456789012:stateMachine:Test'}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SDWebImage 不接受来自 Firebase 存储的 StorageReference - SDWebImage Does Not Accept StorageReference from Firebase Storage Firebase Flutter 无法将我的字符串识别为参数 - Firebase Flutter Does Not Recognize My String as Parameter Google CA 是否接受 IP 地址作为 SubjectAltNames,我该如何 go 关于这个? - Does Google CA accept IP addresses as SubjectAltNames and how can I go about this? amazons3.listObjects(bucket,prefix) 是否接受正则表达式作为前缀来查找对象? - Does amazons3.listObjects(bucket,prefix) accept regex as a prefix to find objects? ssm参数不存在时如何做条件 - How to make a condition when the ssm parameter does not exist 使用 FieldPath 更新字段,更新不接受 FieldPath 作为参数 - Firebase Flutter - Update Field with FieldPath, update doesn't accept FieldPath as parameter - Firebase Flutter “为不需要它们的模板指定的参数值。” 尝试通过 AWS cloudformation 部署一致性包时 - "Parameter values specified for a template which does not require them." when trying to deploy a conformance pack via AWS cloudformation Go 从最快的工人那里接受 function - Go Accept from the fastest worker function 为什么terraform一直在更新rds集群的参数组? - Why does terraform keeps updating parameter group of rds cluster? 为什么Google Cloud Function HTTP 需要main function 中的一个参数? - Why does Google Cloud Function HTTP need a parameter in the main function?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM