如何解决Step Functions 忽略参数,使用默认输入执行
我不知道这是我自己的错误还是亚马逊的错误,因为我无法正确理解发生了什么。
我有以下 Step Function(目前正在进行中),它负责验证输入,然后将其发送到 SQS lambda(CreateInAuth0 步骤)。
我的问题是,显然 SQS 函数正在使用默认参数执行,失败,重试,然后使用 Step Function 中指定的参数。 (或者至少这是我从日志中收集的信息)。
我想知道为什么它在第一次运行时忽略了参数。这是我能收集到的所有信息。
TaskStateEntered
和 TaskScheduled
之间似乎有区别(我认为没关系)。
{
"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
}
}
}
这是视觉效果:
注意:我在 SQS 函数中有一个 try/catch 语句,它包装了整个 SQS 的执行。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。