Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

toastypy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toastypy

Simple python package for keeping your lambda functions warm using an eventbridge schedule

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

🍞 Toasty - The Lambda Warmer

Toasty is a simple Python library designed to keep your AWS Lambda functions warm using an EventBridge schedule. It provides a decorator @toasty for your Lambda functions and a CDK construct LambdaWarmer for setting up the warming schedule.

Installation

You can install the Toasty library using pip:

pip install toastypy

Usage

Toasty Wrapper

The @toasty wrapper can be used to decorate your Lambda functions. Here's an example:

from toastypy.toastypy import toasty

@toasty
def my_lambda_function(event, context):
    # Your function logic here
    pass

LambdaWarmer CDK Constuct

The LambdaWarmer construct can be used in your CDK stack to set up the warming schedule for your Lambda functions. Here's an example:

from aws_cdk import aws_lambda as _lambda
from toastypy.constructs.lambda_warmer import LambdaWarmer

# Assuming `app` and `stack_id` are your CDK app and stack ID
my_lambda = _lambda.Function(
    app, "MyLambdaFunction",
    # Lambda function properties here
)

LambdaWarmer(
    app, "MyLambdaWarmer",
    lambda_to_warm_arn=my_lambda.function_arn,
    concurrency=20,
    environment="nonprod",
)

In this example, LambdaWarmer is set up to warm my_lambda function. The concurrency parameter specifies how many concurrent executions to use for warming, and environment is an optional parameter for specifying the environment.

Please refer to the LambdaWarmer and toasty in the source code for more details.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc