Skip to content

Latest commit

 

History

History
212 lines (129 loc) · 6.88 KB

API.md

File metadata and controls

212 lines (129 loc) · 6.88 KB

Warm your Lambda Functions With a Blowtorch

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.

Example

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
});

API Reference

Constructs

LambdaBlowtorch

Warms a Lambda function to a desired level of concurrency.

Initializers

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.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { LambdaBlowtorch } from '@wheatstalk/cdk-lambda-blowtorch'

LambdaBlowtorch.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


Structs

LambdaBlowtorchProps

Initializer

import { LambdaBlowtorchProps } from '@wheatstalk/cdk-lambda-blowtorch'

const lambdaBlowtorchProps: LambdaBlowtorchProps = { ... }

Properties

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.

desiredConcurrencyRequired
public readonly desiredConcurrency: number;
  • Type: number

The desired level of concurrency.


targetRequired
public readonly target: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The lambda function to warm.


logOptional
public readonly log: boolean;
  • Type: boolean
  • Default: false

Show blowtorch log messages.


warmingIntervalOptional
public readonly warmingInterval: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.minutes(1)

The interval between warming events at the desired level of concurrency.


warmingPayloadOptional
public readonly warmingPayload: string;
  • Type: string
  • Default: "{}"

Payload to send to the function when warming.