1 Answer
- Newest
- Most votes
- Most comments
1
Finally I resolved this issue using L1 Rule Construct:
// Creating input for target
const input = JSON.stringify({
job_name: jobAndRuleName,
file_path: schedule.file_path,
cpu: this.get_cpu(schedule?.cpu),
ram: this.get_ram(this.get_cpu(schedule?.cpu)),
job_queue: 'JOB-QUEUE',
job_definition: 'JOB-DEFINITION',
});
// Creating rule
new events.CfnRule(this, jobAndRuleName, {
name: jobAndRuleName,
description: `This rule is created via CDK for file: ${schedule.file_path}`,
scheduleExpression: `cron(${schedule.cron})`,
state: schedule?.disable ? 'DISABLED' : 'ENABLED',
targets: [
{
arn: this.lambda.functionArn,
id: 'Target-SUBMIT-JOB-LAMBDA',
input: input,
},
],
});
answered 13 days ago
Relevant content
- asked 12 days ago
- asked 8 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago