简体   繁体   English

通过 boto3 将多个触发器添加到同一个胶水工作流时出错

[英]error while adding multiple triggers to same glue workflow via boto3

Task that I wanted to achieve is: I wanted to create workflow, add jobs and triggers to workflow and run the workflow我想要实现的任务是:我想创建工作流,向工作流添加作业和触发器并运行工作流

I am using below code to create the workflow我正在使用下面的代码来创建工作流程

import boto3
def create_workflow(wf_name):
response = client.create_workflow(
Name=wf_name,
Description='string'
)
return response['Name']
wf_name=create_workflow('wf_dev_jan_5th')

Below code I have used to add job and trigger to existing workflow下面的代码是我用来向现有工作流程添加作业和触发器的

response_trigger=client.create_trigger(
Name="new_trigger",
WorkflowName="wf_dev_jan_5th",Type='ON_DEMAND',Actions=[
    {
        'JobName': 'abc_dev",
        'Arguments': {
            'string': 'string'
        },
        'Timeout': 123,
        'SecurityConfiguration': 'string',
        'NotificationProperty': {
            'NotifyDelayAfter': 123
        }
        
    },
])

From above code I could see the workflow created with name.从上面的代码中,我可以看到使用名称创建的工作流。 I have two jobs one with 'abc_dev' and 'def_dev'我有两份工作,一份是 'abc_dev' 和 'def_dev'

When I created trigger name with new_trigger on workflow wf_dev_jan_5th it didn't throw any error当我在工作流 wf_dev_jan_5th 上使用 new_trigger 创建触发器名称时,它没有抛出任何错误

But when I created trigger name with new_trigger_1 with different job ie def_dev on same workflow wf_dev_jan_5th it is throwing below error但是当我在同一个工作流 wf_dev_jan_5th 上使用不同的作业 ie def_dev 使用 new_trigger_1 创建触发器名称时,它会抛出以下错误

 error:IdempotentParameterMismatchException: An error occurred (IdempotentParameterMismatchException) when calling the CreateTrigger operation: Trigger with name 'new_trigger' already submitted with different configuration

Can anyone help here please任何人都可以在这里帮忙吗

I found a solution using boto3 create_trigger() where we could add triggers and jobs to workflow我找到了一个使用 boto3 create_trigger() 的解决方案,我们可以在其中将触发器和作业添加到工作流中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM