deployCloudwatchEvent

Exports an async function that creates a CloudWatchEventRule for our post Lambdas. The rule is to execute the Lambdas once every minute. What the post queue Lambdas do is pull tokens of the SQS queue in a predetermined loop. Between that looping logic, and the once a minute execution rule set here, we achieve the rate the user wants.

Source:

(require("deployCloudwatchEvent"))(region, postLambdaArn, cronJobName) → {String}

Source:

Exports deployCloudwatchEvent

Parameters:
Name Type Description
region String

A constant destructured from the CLI user's answers in deploy.js. Like "us-east-2".

postLambdaArn String

A Amazon Resource Number referring to the post queue Lambda we need to put this cloudwatch rule on.

cronJobName String

Initialized in deploy.js, looks like beekeeper-${PROFILE_NAME}-cloudwatcheventcron

Returns:

Returns a Amazon Resource Number identifying this rule we just created.

Type
String

Methods

(async, inner) createCloudWatchEventRule(cloudwatchEventsClient, cronJobName) → {String}

Source:

Creates the Cloud Watch event rule that executes the post queue Lambdas once a minute

Parameters:
Name Type Description
cloudwatchEventsClient cloudwatchEventsClient

Looks like new CloudWatchEventsClient({ region });

cronJobName String

Initialized in deploy.js, looks like beekeeper-${PROFILE_NAME}-cloudwatcheventcron

Returns:

Returns an Amazon Resource Number identifying the rule we create here

Type
String