{"id":18248210,"url":"https://github.com/serverless-components/aws-lambda-cron","last_synced_at":"2025-08-22T11:36:20.197Z","repository":{"id":49060303,"uuid":"285410028","full_name":"serverless-components/aws-lambda-cron","owner":"serverless-components","description":"Serverless Lambda Cron - the fastest and easiest way to schedule lambda functions in the cloud!","archived":false,"fork":false,"pushed_at":"2021-07-01T06:37:46.000Z","size":32,"stargazers_count":13,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-23T04:29:05.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-components.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-05T21:39:57.000Z","updated_at":"2023-09-08T06:38:36.000Z","dependencies_parsed_at":"2022-09-24T01:32:52.687Z","dependency_job_id":null,"html_url":"https://github.com/serverless-components/aws-lambda-cron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serverless-components/aws-lambda-cron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-lambda-cron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-lambda-cron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-lambda-cron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-lambda-cron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-components","download_url":"https://codeload.github.com/serverless-components/aws-lambda-cron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-lambda-cron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271630374,"owners_count":24793308,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-05T09:36:16.016Z","updated_at":"2025-08-22T11:36:20.171Z","avatar_url":"https://github.com/serverless-components.png","language":"JavaScript","readme":"# Serverless AWS Lambda Cron Component\n\nThis Serverless Framework Component is a ready-to-go Lambda function that runs on whatever schedule you want!\n\n\u003cbr/\u003e\n\n- [x] **Never Pay For Idle** - No invocations, no cost. Averages $0.0000002-$0.0000009 per request.\n- [x] **Zero Configuration** - All we need is your code, then just deploy (advanced config options are available).\n- [x] **Fast Deployments** - Deploy to the cloud in seconds.\n- [x] **Realtime Logging** - Rapidly develop on the cloud w/ real-time logs and errors in the CLI.\n- [x] **Team Collaboration** - Collaborate with your teammates with shared state and outputs.\n\n\u003cbr/\u003e\n\n# Quick Start\n\n## Install\n\nTo get started with this component, install the latest version of the Serverless Framework:\n\n```\nnpm install -g serverless\n```\n\nAfter installation, make sure you connect your AWS account by setting a provider in the org setting page on the [Serverless Dashboard](https://app.serverless.com).\n\n## Initialize\n\nThe easiest way to start using the lambda-cron component is by initializing the `aws-lambda-cron` template. Just run this command:\n\n```\nserverless init aws-lambda-cron-template\ncd aws-lambda-cron-template\n```\n\nYou should now have a directory that looks something like this:\n\n```\n|- serverless.yml\n|- src/handler.js\n```\n\nThe `serverless.yml` file is where you define your component config. It looks something like this:\n\n```yml\ncomponent: aws-lambda-cron@dev\norg: your-org-here\nname: lambda-cron\ninputs:\n  src: ./src/\n  schedule: rate(1 minute)\n```\n\nYou can add your own code in `src` and run it at your own schedule!\n\nFor more configuration options for the `serverless.yml` file, [check out the Configuration section](#configuration-reference) below.\n\n# Your code\n\nAll you need to do is add javascript file that exposes a method called `handler`, and the rest is up to you!\n\n`src/index.js`\n\n```js\nconst handler = async () =\u003e {\n  return \"we did it\";\n};\n\nmodule.exports = {\n  handler,\n};\n```\n\n# Configuration Reference\n\nThe most important configuration option that's required is the `schedule` expression. This must be provided, and supports any of the expressions listed [here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#:~:text=CloudWatch%20Events%20supports%20cron%20expressions%20and%20rate%20expressions.\u0026text=For%20example,%20with%20a%20cron,hour%20or%20once%20every%20day.)\n\nExamples:\n\n```\nschedule: rate(1 minute)\nschedule: rate(1 day)\nschedule: cron(0 12 * * ? *) // every day at 12:00pm UTC\n```\n\nFull reference:\n\n```\ncomponent: aws-lambda-cron       # (required) name of the component. In that case, it's express. You will want to pin this to a specific version in production via semantic versioning, like this: lambda-cron@0.0.2. Run 'serverless registry lambda-cron' to see available versions.\nname: my-lambda-cron             # (required) name of your express component instance.\norg: serverlessinc               # (optional) serverless dashboard org. default is the first org you created during sign up.\napp: myApp                       # (optional) serverless dashboard app. default is the same as the name property.\nstage: dev                       # (optional) serverless dashboard stage. default is dev.\n\ninputs:\n  schedule:                      # (required) Cron expression or rate expression for how often your lambda should be triggered.\n  src: ./                        # (optional) path to the source folder. default is a hello world app.\n  memory: 512                    # (optional) lambda memory size.\n  timeout: 10                    # (optional) lambda timeout.\n  description: My Cron Lambda    # (optional) lambda \u0026 api gateway description.\n  env:                           # (optional) env vars.\n    FOO: 'bar'\n  region: us-east-2              # (optional) aws region to deploy to. default is us-east-1.\n  layers:                        # (optional) lambda layers to add to this lambda function. default is an empty array.\n    - aws:layer:arn:1\n    - aws:layer:arn:2\n```\n\n# CLI Reference\n\n## deploy\n\nTo deploy, simply run `deploy` from within the directory containing the `serverless.yml` file:\n\n```\nserverless deploy\n```\n\nIf you'd like to know what's happening under the hood and see realtime logs, you can pass the `--debug` flag:\n\n```\nserverless deploy --debug\n```\n\n## dev (dev mode)\n\nInstead of having to run `serverless deploy` every time you make changes you wanna test, you can enable **dev mode**, which allows the CLI to watch for changes in your source directory as you develop, and deploy instantly on save.\n\nTo enable dev mode, simply run the following command from within the directory containing the `serverless.yml` file:\n\n```\nserverless dev\n```\n\nDev mode also enables live streaming logs from your Lambda Cron function so that you can see the results of your code changes right away on the CLI as they happen.\n\n## info\n\nAnytime you need to know more about your running Lambda Cron instance, you can run the following command to view the most critical info:\n\n```\nserverless info\n```\n\nThis is especially helpful when you want to know the outputs of your instances so that you can reference them in another instance. It also shows you the status of your instance, when it was last deployed, how many times it was deployed, and the error message \u0026 stack if the latest deployment failed.\n\nTo dig even deeper, you can pass the `--debug` flag to view the state object of your component instance:\n\n```\nserverless info --debug\n```\n\n## remove\n\nIf you wanna tear down your entire Lambda Cron infrastructure that was created during deployment, just run the following command in the directory containing the `serverless.yml` file:\n\n```\nserverless remove\n```\n\nThe Lambda Cron component will then use all the data it needs from the built-in state storage system to delete only the relevant cloud resources that it created.\n\nJust like deployment, you could also specify a `--debug` flag for realtime logs from the GraphQL component running in the cloud:\n\n```\nserverless remove --debug\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Faws-lambda-cron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-components%2Faws-lambda-cron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Faws-lambda-cron/lists"}