adding EventBatchingCondition to CDK trigger
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.
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.
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.
Relevant questions
trigger glue job from s3
Accepted Answerasked 3 months agoHow to add/suppress custom scope in AWS Pre-Token Generation trigger ?
asked 3 months agoTrigger AWS DeepLens Lambda
asked 3 years agoHow to create a Glue Workflow programmatically?
Accepted AnswerHow to set "compressionType" property in Glue Table via CDK
asked 5 months agoCan I use CloudWatch Logs to trigger a Lambda function?
Accepted Answerasked 2 years agoAWs trigger EventBatchingCondition/BatchWindow is not optional
asked 2 months agoadding EventBatchingCondition to CDK trigger
asked 2 months agoHow to get the enable / disable of the trigger set in lambda with boto3.
asked 2 years agoCDK AWS trigger with type EVENT
asked 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 ?