如何解决AWS Step function error :状态机定义中存在 Amazon States Language 错误修复错误以继续
我是 AWS 步骤函数的新手。 尝试创建粘合作业的基本 ETL 流程。完成状态机定义后,我可以看到正在生成的图形,但出现一般错误“状态机定义中存在亚马逊状态语言错误。修复错误以继续”, error message 这不允许我继续。
这是代码和图表:
{
"Comment": "DRC downstream glue jobs execution step function:slf_aws_can_dbisdel_everyone_drc_amp","StartAt": "startFlow","States": {
"Comment": "varIoUs state types of the Amazon States Language","startFlow": {
"Comment": "Pass states are useful when constructing and debugging state machines.","Type": "Pass","Next": "stg_ods"
},"stg_ods": {
"Type": "Task","Resource": "arn:aws:states:::glue:startJobRun.sync","Parameters": {
"JobName": "stage_job_name"
},"Next": "ods_job"
},"ods_job": {
"Type": "Task","Parameters": {
"JobName": "main_job_name"
},"Next": "Wait 3 sec"
},"Wait 3 sec": {
"Comment": "A Wait state delays the state machine from continuing for a specified time.","Type": "Wait","Seconds": 3,"Next": "parallel_stg_adr"
},"parallel_stg_adr": {
"Comment": "A Parallel state can be used to create parallel branches of execution in your state machine.","Type": "Parallel","Branches": [
{
"StartAt": "stg_job1","States": {
"stg_job1": {
"Type": "Task","Parameters": {
"JobName": "stg_job_name1"
},"End": true
}
}
},{
"StartAt": "stg_job2","States": {
"stg_job2": {
"Type": "Task","Parameters": {
"JobName": "stg_job_name2"
},"End": true
}
}
}
],"Next": "parallel_adr_job"
},"parallel_adr_job": {
"Comment": "A Parallel state can be used to create parallel branches of execution in your state machine.","Branches": [
{
"StartAt": "job1","States": {
"job1": {
"Type": "Task","Parameters": {
"JobName": "some_glue_job","Arguments": {
"--target_table": "some_string_table","--calendar_key": "some_string"
}
},{
"StartAt": "job2","States": {
"job2": {
"Type": "Task","Next": "end_job"
},"end_job": {
"Type": "Pass","End": true
}
}
}
解决方法
"Comment": "Amazon States Language 的各种状态类型",
第 5 行的这个似乎不正确。 “州”地图不能有“评论”键。删除它然后尝试。其余配置看起来正确。
编辑 1
如果 Step Function 的类型是 Express,“.sync”函数将不起作用。尝试将 ARN 更改为
"Resource": "arn:aws:states:::glue:startJobRun"
并且您应该能够保存您的 Step Function。然后,您必须弄清楚如何设置不同的 Glue 任务。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。