{"id":21377219,"url":"https://github.com/softchef/cdk-schedule-function","last_synced_at":"2025-07-13T10:31:29.260Z","repository":{"id":37020990,"uuid":"380560783","full_name":"SoftChef/cdk-schedule-function","owner":"SoftChef","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-09T01:51:46.000Z","size":3524,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-11T03:43:52.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SoftChef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-26T17:31:30.000Z","updated_at":"2023-08-03T16:25:43.000Z","dependencies_parsed_at":"2022-07-07T21:03:31.204Z","dependency_job_id":null,"html_url":"https://github.com/SoftChef/cdk-schedule-function","commit_stats":null,"previous_names":[],"tags_count":210,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftChef%2Fcdk-schedule-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftChef%2Fcdk-schedule-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftChef%2Fcdk-schedule-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftChef%2Fcdk-schedule-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SoftChef","download_url":"https://codeload.github.com/SoftChef/cdk-schedule-function/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225872135,"owners_count":17537361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T09:19:36.457Z","updated_at":"2024-11-22T09:19:37.480Z","avatar_url":"https://github.com/SoftChef.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CDK Construct - Schedule Function\n\n[![npm version](https://badge.fury.io/js/%40softchef%2Fcdk-schedule-function.svg)](https://badge.fury.io/js/%40softchef%2Fcdk-schedule-function)\n![Release](https://github.com/SoftChef/cdk-schedule-function/workflows/Release/badge.svg)\n![npm](https://img.shields.io/npm/dt/@softchef/cdk-schedule-function?label=NPM%20Downloads\u0026color=orange)\n\nScheduleFunction 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.\n\nYou 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...\n\n![Architecture](docs/schedule-function-architecture.png)\n\n---\n\n## Installation\n\n```\nnpm install @softchef/cdk-schedule-function\n\nor\n\nyarn add @softchef/cdk-schedule-function\n```\n\n## Usage\n\n```\nconst scheduleFunction = new ScheduleFunction(stack, 'ScheduleFunction', {});\n\nscheduleFunction.addTargetFunction('CreateJob', targetFunction);\n\n```\n\nThe Target Function is actual to execute function for business logic. The 'CreateJob' is targetType to identify this function when schedule running.\n\nYou can add many targetFunction to process different logic.\n\n\n## Hook\n\n```\nconst restApi = new apigateway.RestApi(stack, 'RestApi');\n\nconst rootResource = restApi.root.addResource('schedules');\n\nrootResource.addMethod('POST', apigateway.LambdaIntegration(scheduleFunction.createScheduleFunction));  // Create schdules\nrootResource.addMethod('GET', apigateway.LambdaIntegration(scheduleFunction.listSchedulesFunction));  // List schdules\n\nconst scheduleResource = rootResource.addResource('{scheduleId}');\n\nscheduleResource.addMethod('GET', apigateway.LambdaIntegration(scheduleFunction.fetchScheduleFunction));  // Fetch schdule\nscheduleResource.addMethod('PUT', apigateway.LambdaIntegration(scheduleFunction.updateSchedulesFunction));  // Update schdule\nscheduleResource.addMethod('PUT', apigateway.LambdaIntegration(scheduleFunction.deleteSchedulesFunction));  // Delete schdule\n\nmore...\n```\n\n## Example\n\n[Demo stack](./src/demo)\n\n## Roadmap\n\n- DispatchTarget performance up(StepFunction or SQS)\n- Export more internal resource\n- DynamoDB indexs/capacity best optimization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftchef%2Fcdk-schedule-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftchef%2Fcdk-schedule-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftchef%2Fcdk-schedule-function/lists"}