Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async addRule(item, payload) {
const name = `${process.env.stackName}-custom-${item.name}`;
const r = await Events.putEvent(
name,
item.rule.value,
item.state,
'Rule created by cumulus-api'
);
await Events.putTarget(name, this.targetId, process.env.invokeArn, JSON.stringify(payload));
return r.RuleArn;
}