Abdul Haseeb
Abdul Haseeb

Reputation: 512

Pass Input of Step Function to Glue JOb

I'm trying to pass input from step function to Glue Job. Following is my test state machine, enter image description here

This is the code I'm using

enter image description here

This is the input I' giving to state machine,

{ "Comment": "Insert your JSON here" }

Issue is that values are not passing to the Glue

Upvotes: 0

Views: 2828

Answers (1)

Prabhakar Reddy
Prabhakar Reddy

Reputation: 5154

The syntax that you are using is not valid. Please check below example or this link for more.

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"
                            }
                        ]
                      },
                      
                  }
              }

Upvotes: 2

Related Questions