gpt4 book ai didi

amazon-web-services - 适用于具有多个谓词条件的 Glue 的 AWS CloudFormation 模板

转载 作者:行者123 更新时间:2023-12-03 07:34:29 26 4
gpt4 key购买 nike

我需要为 AWS Glue 编写 AWS CloudFormation 模板代码,我在其中为多个 Glue 作业创建单个模板。我为第二份工作添加了谓词条件。不幸的是,虽然谓词接受多个条件,但它只接受前一个作业的一个状态,就像前一个作业状态成功、失败或停止一样,下一个作业仍然应该运行。但我需要它在多种状态下运行,即使上一个作业具有下一个作业应添加的任何成功/失败/停止状态。

如果我给出多个条件,它会给出错误,指出存在重复的作业,因为我在所有条件下给出相同的作业名称

我在模板中编写了以下代码片段

'''
Resources:
WF:
Type: AWS::Glue::Workflow
Properties:
Description: workflow for Parallel Jobs
Name: Sequence_Job_Triggers

SequenceTrigger:
Type: AWS::Glue::Trigger
Properties:
Name: Job_Trigger_1
Type: ON_DEMAND
Description: Description
WorkflowName: !Ref WF
Actions:
- JobName: job1
SequenceTrigger:
Type: AWS::Glue::Trigger
Properties:
Name: Job_Trigger_2
Type: CONDITIONAL
Description: Description
WorkflowName: !Ref WF
Predicate:
Conditions:
- LogicalOperator: EQUALS
JobName: job1
State: SUCCEEDED
Actions:
- JobName: job2
'''

最佳答案

你不能只创建两个触发器吗,至少这对我有用:

 SucceededSequenceTrigger:
Type: AWS::Glue::Trigger
Properties:
Name: Succeeded_Job_Trigger_2
Type: CONDITIONAL
Description: Description
WorkflowName: !Ref WF
Predicate:
Conditions:
- LogicalOperator: EQUALS
JobName: job1
State: SUCCEEDED
Actions:
- JobName: job2

FailedSequenceTrigger:
Type: AWS::Glue::Trigger
Properties:
Name: Failed_Job_Trigger_2
Type: CONDITIONAL
Description: Description
WorkflowName: !Ref WF
Predicate:
Conditions:
- LogicalOperator: EQUALS
JobName: job1
State: FAILED
Actions:
- JobName: job2

关于amazon-web-services - 适用于具有多个谓词条件的 Glue 的 AWS CloudFormation 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67330407/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com