Step Functions 忽略参数,使用默认输入执行

问题描述

我不知道这是我自己的错误还是亚马逊的错误,因为我无法正确理解发生了什么。

我有以下 Step Function(目前正在进行中),它​​负责验证输入,然后将其发送到 SQS lambda(CreateInAuth0 步骤)。

我的问题是,显然 SQS 函数正在使用认参数执行,失败,重试,然后使用 Step Function 中指定的参数。 (或者至少这是我从日志中收集的信息)。

我想知道为什么它在第一次运行时忽略了参数。这是我能收集到的所有信息。

TaskStateEnteredTaskScheduled 之间似乎有区别(我认为没关系)。

{
    "Comment": "Add the students to the platform and optionally adds them to their respective grades","StartAt": "AddStudents","States": {
        "AddStudents": {
            "Comment": "Validates that the students are OK","Type": "Task","Resource": "@AddStudents","Next": "Parallel"
        },"Parallel": {
            "Type": "Parallel","Next": "FinishExecution","Branches": [
                {
                    "StartAt": "CreateInAuth0","States": {
                        "CreateInAuth0": {
                            "Type": "Task","Resource": "arn:aws:states:::sqs:sendMessage.waitForTaskToken","Parameters": {
                                "QueueUrl": "@SQS_StudentsRegistrationSQSFifo","MessageBody": {
                                    "execId.$": "$.result.execId","tenantType.$": "$.result.tenantType","tenantId.$": "$.result.tenantId","studentsToCreate.$": "$.result.newStudents.success","TaskToken.$": "$$.Task.Token","studentsSucceeded": []
                                }
                            },"End": true
                        }
                    }
                }
            ]
        },"FinishExecution": {
            "Comment": "This signals the ending in DynamoDB that the transaction finished","End": true,"Resource": "arn:aws:states:::dynamodb:putItem","ResultPath": "$.dynamoDB","Parameters": {
                "TableName": "@SchonDB","Item": {
                    "pk": {
                        "S.$": "$.arguments.tenantId:exec:$.id"
                    },"sk": {
                        "S": "result"
                    },"status": {
                        "S": "FINISHED"
                    },"type": {
                        "S": "@EXEC_TYPE"
                    }
                }
            },"Retry": [
                {
                    "ErrorEquals": [
                        " States.Timeout"
                    ],"IntervalSeconds": 1,"MaxAttempts": 5,"BackoffRate": 2.0
                }
            ],"Catch": [
                {
                    "ErrorEquals": [
                        "States.ALL"
                    ],"Next": "FinishExecutionIfFinishErrored"
                }
            ]
        },"FinishExecutionIfFinishErrored": {
            "Type": "Pass","End": true
        }
    }
}

这是视觉效果

enter image description here

这是执行事件历史记录:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

注意:我在 SQS 函数中有一个 try/catch 语句,它包装了整个 SQS 的执行。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)