你好,我正在尝试编排一个glue crawler,使其在我的step函数中使用" Wait for callback ";选择启用。但是,即使爬虫已经完成,步骤函数也会挂起在这一步,并且不会继续进行下一步。
这是我的步进函数的json定义文件
{
"Comment": "A description of my state machine",
"StartAt": "StartCrawler",
"States": {
"StartCrawler": {
"Type": "Task",
"Next": "Glue StartJobRun",
"Parameters": {
"Name": "farmlands-raw-crawler-sam"
},
"Resource": "arn:aws:states:::aws-sdk:glue:startCrawler.waitForTaskToken"
},
"Glue StartJobRun": {
"Type": "Task",
"Resource": "arn:aws:states:::glue:startJobRun.sync",
"Parameters": {
"JobName": "fetch-from-azure-etl-sam"
},
"End": true
}
}
}
这是我使用的阶跃函数角色(使用sam部署)
# Role used to invoke step functions
StepFunctionRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub "StepFunctionRole"
Description: "IAM role for step functions"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- states.amazonaws.com
- lambda.amazonaws.com
Action:
- sts:AssumeRole
Policies:
- PolicyName: root
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "lambda:InvokeFunction"
- "sns:Publish"
- "events:PutTargets"
- "events:PutRule"
- "events:DescribeRule"
- "iam:GetRole"
- "iam:PassRole"
- "states:*"
- "databrew:*"
- "athena:*"
- "glue:*"
- "logs:*"
- "s3:*"
- "sagemaker:*"
Resource:
- "*"
注意我是如何给所有的胶水权限"glue:*",所以我不确定为什么步函数挂在爬虫步骤。我在这里也遵循了完全相同的步骤AWS步进函数卡在一个状态,但OP有胶水作业问题,而不是胶水爬行器
回调不提供爬虫的状态。您需要实现这个功能,它可以轮询爬虫的状态,并在它处于"成功"状态时继续前进。运行后的状态。
你可以在这里阅读如何做到这一点。