This CDK construct warms your Lambda functions. This construct operates by ensuring that a targeted function is invoked concurrently at a degree of concurrency at least once per given interval.
declare const target: aws_lambda.IFunction; // The function you want to warm
new LambdaBlowtorch(stack, 'Blowtorch', {
target, // The lambda function to warm
desiredConcurrency: 50, // The desired degree of concurrency
warmingInterval: Duration.minutes(1), // (optional) Warm once per minute
warmingPayload: JSON.stringify({}), // (optional) warming event payload
});
Warms a Lambda function to a desired level of concurrency.
import { LambdaBlowtorch } from '@wheatstalk/cdk-lambda-blowtorch'
new LambdaBlowtorch(scope: Construct, id: string, props: LambdaBlowtorchProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
LambdaBlowtorchProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: LambdaBlowtorchProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { LambdaBlowtorch } from '@wheatstalk/cdk-lambda-blowtorch'
LambdaBlowtorch.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
import { LambdaBlowtorchProps } from '@wheatstalk/cdk-lambda-blowtorch'
const lambdaBlowtorchProps: LambdaBlowtorchProps = { ... }
Name | Type | Description |
---|---|---|
desiredConcurrency |
number |
The desired level of concurrency. |
target |
aws-cdk-lib.aws_lambda.IFunction |
The lambda function to warm. |
log |
boolean |
Show blowtorch log messages. |
warmingInterval |
aws-cdk-lib.Duration |
The interval between warming events at the desired level of concurrency. |
warmingPayload |
string |
Payload to send to the function when warming. |
public readonly desiredConcurrency: number;
- Type: number
The desired level of concurrency.
public readonly target: IFunction;
- Type: aws-cdk-lib.aws_lambda.IFunction
The lambda function to warm.
public readonly log: boolean;
- Type: boolean
- Default: false
Show blowtorch log messages.
public readonly warmingInterval: Duration;
- Type: aws-cdk-lib.Duration
- Default: Duration.minutes(1)
The interval between warming events at the desired level of concurrency.
public readonly warmingPayload: string;
- Type: string
- Default: "{}"
Payload to send to the function when warming.