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

@softchef/cdk-schedule-function

Package Overview
Dependencies
Maintainers
1
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@softchef/cdk-schedule-function

Manageable schedule to invoke lambda functions

  • 2.0.94
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CDK Construct - Schedule Function

npm version Release npm

ScheduleFunction is CDK Construct, provide lambda functions to manage your schedule with Amazon EventBridge service. It is arrange one-time or multi-times schedule to invoke specify lambda functions. It is not permanent recurly, because you can use original EventBridge rule.

You can hook the lambda functions to your API Gateway to manage your schedules. The schedules will store in the DynamoDB table, you can tracking the schedules status, execution results, etc...

Architecture


Installation

npm install @softchef/cdk-schedule-function

or

yarn add @softchef/cdk-schedule-function

Usage

const scheduleFunction = new ScheduleFunction(stack, 'ScheduleFunction', {});

scheduleFunction.addTargetFunction('CreateJob', targetFunction);

The Target Function is actual to execute function for business logic. The 'CreateJob' is targetType to identify this function when schedule running.

You can add many targetFunction to process different logic.

Hook

const restApi = new apigateway.RestApi(stack, 'RestApi');

const rootResource = restApi.root.addResource('schedules');

rootResource.addMethod('POST', apigateway.LambdaIntegration(scheduleFunction.createScheduleFunction));  // Create schdules
rootResource.addMethod('GET', apigateway.LambdaIntegration(scheduleFunction.listSchedulesFunction));  // List schdules

const scheduleResource = rootResource.addResource('{scheduleId}');

scheduleResource.addMethod('GET', apigateway.LambdaIntegration(scheduleFunction.fetchScheduleFunction));  // Fetch schdule
scheduleResource.addMethod('PUT', apigateway.LambdaIntegration(scheduleFunction.updateSchedulesFunction));  // Update schdule
scheduleResource.addMethod('PUT', apigateway.LambdaIntegration(scheduleFunction.deleteSchedulesFunction));  // Delete schdule

more...

Example

Demo stack

Roadmap

  • DispatchTarget performance up(StepFunction or SQS)
  • Export more internal resource
  • DynamoDB indexs/capacity best optimization

Keywords

FAQs

Package last updated on 09 Aug 2022

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