将 Step 函数的输入传递给 Glue JOb

Pass Input of Step Function to Glue JOb

我正在尝试将输入从 step 函数传递到 Glue Job。 以下是我的测试状态机,

这是我正在使用的代码

这是我给状态机的输入,

{ "Comment": "在此处插入您的 JSON" }

问题是值没有传递给 Glue

您使用的语法无效。请查看以下示例或 this link 了解更多信息。

GlueOrchestrationStateMachine:
        Type: "AWS::StepFunctions::StateMachine"
        Properties:
            RoleArn: !GetAtt StepFunctionsServiceRole.Arn
            DefinitionString: !Sub |-
                  {
                    "StartAt": "Glue StartJobRun",
                    "States": {
                      "Glue StartJobRun": {
                        "Type": "Task",
                        "Resource": "arn:aws:states:::glue:startJobRun.sync",
                        "Parameters": {
                          "JobName.$": "$.job_name",
                          "Arguments": {
                              "--REGION.$": "$.arguments.region",
                              "--TABLE_NAME.$": "$.arguments.table_name",
                              "--S3_OUTPUT_BUCKET.$": "$.arguments.s3_output_bucket",
                              "--S3_OUTPUT_KEY_PREFIX.$": "$.arguments.s3_output_key_prefix",
                              "--DATABASE_NAME.$": "$.arguments.database_name"
                          }
                        },
                        "InputPath": "$",
                        "ResultPath": "$.status",
                        "Next": "Start Crawler",
                        "Catch": [
                            {
                              "ErrorEquals": [ "States.ALL" ],
                              "Next": "Job Failure"
                            }
                        ]
                      },
                      
                  }
              }