deployPostLambda

Exports an async function that deploys our post queue Lambda, which is the Lambda that pulls tokens off the SQS queue.

Source:

(require("deployPostLambda"))(region, lambdaName, sqsUrl, asset, roleArn, dynamoName, rate) → {String}

Source:

Exports deployPostLambda

Parameters:
Name Type Description
region String

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

lambdaName String

A constant beekeeper-${PROFILE_NAME}-postlambda

sqsUrl String

URL of the sqs queue returned by deploySQS.js

asset String

This is the path of the index.js.zip file holding the code for this Lambda

roleArn String

Amazon resource number for the kitchen sink role returned by createRole()

dynamoName String

Constant initialized in deploy.js, looks like beekeeper-${PROFILE_NAME}-ddb

rate Number

A constant destructured from answers in the CLI, used by the frontend JavaScript to show dynamic information to the user in waiting room

Returns:

Returns the ARN of the post queue Lambda

Type
String

Methods

(async, inner) createPostLambda(lambda, lambdaName, sqsUrl, code, roleArn, region, dynamoName, rate) → {String}

Source:

Function creates a post-queue Lambda that pulls tokens from the queue and writes them to the database.

Parameters:
Name Type Description
lambda LambdaClient

Looks like new LambdaClient({ region })

lambdaName String

A constant beekeeper-${PROFILE_NAME}-postlambda

sqsUrl String

URL of the sqs queue returned by deploySQS.js

code String

This is the path of the index.js.zip file holding the code for this Lambda.

roleArn String

Amazon resource number for the kitchen sink role returned by createRole()

region String

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

dynamoName String

Constant initialized in deploy.js, looks like beekeeper-${PROFILE_NAME}-ddb

rate Number

A constant destructured from answers in the CLI, used by the frontend JavaScript to show dynamic information to the user in waiting room.

Returns:

ARN of this Lambda

Type
String

(async, inner) setLambdaConcurrency(lambda, lambdaName, rate)

Source:

Function sets a reserce concurrency amount of Lambdas for post-queue and uses the rate to determine it, keeping in mind there are a specific number of loops happening in the post Lambda code in its index.js that together work out to be the rate desired.

Parameters:
Name Type Description
lambda LambdaClient

Looks like new LambdaClient({ region })

lambdaName String

A constant beekeeper-${PROFILE_NAME}-postlambda

rate Number

A constant destructured from answers in the CLI, used by the frontend JavaScript to show dynamic information to the user in waiting room.