From 1d622f39b857a63864c3e0b75d917ba56c359f81 Mon Sep 17 00:00:00 2001 From: "Shane P. Van Hart" Date: Wed, 2 Aug 2017 15:27:52 -0400 Subject: [PATCH] Added the ability to set constants when scheduling a Lambda function Cloudwatch event. --- lib/event_sources.json.example | 7 ++++++- lib/schedule_events.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/event_sources.json.example b/lib/event_sources.json.example index 1b2d7936..69db547d 100644 --- a/lib/event_sources.json.example +++ b/lib/event_sources.json.example @@ -11,7 +11,12 @@ { "ScheduleName": "node-lambda-test-schedule", "ScheduleState": "ENABLED", - "ScheduleExpression": "rate(1 hour)" + "ScheduleExpression": "rate(1 hour)", + "Input": + { + "key": "value", + "key2": "value" + } } ] } diff --git a/lib/schedule_events.js b/lib/schedule_events.js index 1c6ac503..186c92fc 100644 --- a/lib/schedule_events.js +++ b/lib/schedule_events.js @@ -71,7 +71,8 @@ class ScheduleEvents { Rule: params.ScheduleName, Targets: [{ Arn: params.FunctionArn, - Id: this._functionName(params) + Id: this._functionName(params), + Input: JSON.stringify(params.Input) }] } }