带 Redshift 集群的步进函数

Step function with Redshift cluster

正在构建一个步骤函数来编排 ETL 管道,但不断出现此错误。这是我的代码,下面是 AWS 文档。 https://docs.aws.amazon.com/step-functions/latest/dg/sample-etl-orchestration.html

 "GetStateOfCluster": {
      "Type": "Task",
      "Resource": "lambda,
      "TimeoutSeconds": 180,
      "HeartbeatSeconds": 60,
      "Next": "IsClusterAvailable",
      "InputPath": "$",
      "ResultPath": "$.clusterStatus"
    },
    "IsClusterAvailable": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.clusterStatus",
          "StringEquals": "available",
          "Next": "runetljobs"
        },
        {
          "Variable": "$.clusterStatus",
          "StringEquals": "unavailable",
          "Next": "ClusterUnavailable"
        },
        {
          "Variable": "$.clusterStatus",
          "StringEquals": "paused",
          "Next": "InitializeResumeCluster"
        },
        {
          "Variable": "$.clusterStatus",
          "StringEquals": "resuming",
          "Next": "ClusterWait"
        }
      ],
      "Default": "DefaultState"
    },
    "DefaultState": {
      "Type": "Fail",
      "Error": "DefaultStateError",
      "Cause": "No Matches!"
    },
    "ClusterUnavailable": {
      "Type": "Fail",
      "Cause": "Redshift cluster is not available",
      "Error": "Error"
    },
    "ClusterWait": {
      "Type": "Wait",
      "Seconds": 900,
      "Next": "InitializeCheckCluster"
    },

    "InitializeResumeCluster": {
      "Type": "Pass",
      "Next": "ResumeCluster",
      "Result": {
        "input": {
          "redshift_cluster_id": "redshift cluster id",
          "operation": "resume"
        }
      }
    },
    "ResumeCluster": {
      "Type": "Task",
      "Resource": "lambda",
      "TimeoutSeconds": 180,
      "HeartbeatSeconds": 60,
      "Next": "ClusterWait",
      "InputPath": "$",
      "ResultPath": "$"
    },

即使集群状态显示 'available' 也直接进入默认状态,而应该进入 runetljob 阶段。在文档中,他们没有默认值,如果我们不添加默认值,错误是,

"cause": "An error occurred while executing the state 'IsClusterAvailable' (entered at the event id #14). Failed to transition out of the state. The state does not point to a next state."

您没有在状态定义中看到状态“runetljobs”。