By using AWS re:Post, you agree to the Terms of Use
/adding EventBatchingCondition to CDK trigger/

adding EventBatchingCondition to CDK trigger

0

Hi team, I want to create a glue trigger via the CDK and associate it with a workflow,

the trigger is of type "EVENT"

I want to add the following config to my trigger via CDK :

"EventBatchingCondition": {
            "BatchSize": 5,
            "BatchWindow": 900
        }

but did not find any object allowing me to add this config to the CfnTrigger.

this is my CDK code :

const glueEdwWorkflowTrigger = new glue.CfnTrigger(
      this,
      "trigger",
      {
        name: "trigger",
        workflowName: myWorkFlow.name,
        type: "EVENT",

        predicate:{conditions:[{}]},
        actions: [
          {
            jobName: myCfnJob.name,
            arguments: {},
          },
        ]
      }
    );

how can I add EventBatchingCondition info to my CfnTrigger?

thanks a lot.

1 Answers
0

Hi there,

As of now the support of EventBatchingCondition property on a trigger is not yet available in CloudFormation, thus CfnTrigger construct does not have such capability neither. You can track this open Github issue for latest update on this feature request. As of now, one workaround can be to use the CDK custom resource AwsCustomResource construct to invoke UpdateTrigger API to add EventBatchingCondition, once the trigger was created.

SUPPORT ENGINEER
answered 2 months ago
  • Thank you for your answer! could you please share with me an example of how can I use AwsCustomResource to UpdateTrigger and add EventBatchingCondition ?

  • Hey there, I don't have any specific example for UpdateTrigger, the you can find some examples here that show the same idea to make API calls in custom resource.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions