Sivaraj P
Sivaraj P

Reputation: 86

How can i schedule an event in aws from my node app (which is running on same aws) that calls an api on a particular timestamp?

I have my node application running on AWS instance. I would like to trigger an event from AWS on a particular timestamp that will hit an api in my application with specific parameters that are set when the event(this event also has to be created from my app with those parameters) was scheduled.

Upvotes: 1

Views: 1126

Answers (1)

Chris Williams
Chris Williams

Reputation: 35176

You can create a scheduled event by creating a CloudWatch event as a scheduled rule. You can use an expression that enables you have a specific date time only by specifying the day, month and year in the cron expression.

The CloudWatch event itself could trigger a Lambda function that can execute against your API.

You can configure the CloudWatch event with constant values to pass in these custom arguments into your Lambda function.

Scheduling a rule can be done programmatically via the put-rule command either via cli or sdk

Upvotes: 4

Related Questions