简体   繁体   中英

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'

When I created trigger name with new_trigger on workflow wf_dev_jan_5th it didn't throw any error

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

 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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