Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addEventRule(rule: Rule, target: Events.IEventRuleTarget) {
const name = rule.path.split('/').pop() || 'rootPath'
const schedule = {
scheduleExpression: rule.cron,
}
const eventRule = new Events.EventRule(this, name, schedule)
eventRule.addTarget(target, { jsonTemplate: `{"path":"${rule.path}"}` })
return eventRule
}