The missing cron CLI for AWS Cloudwatch and Lambda
What is it?
Do you have an AWS account? Great. Do you want to run cron jobs in the cloud?
Cronyo provides a simple CLI to manage your cron jobs on AWS.
In addition, Cronyo can instantly deploy a couple of super-simple, helpful and secure lambda functions to perform HTTP GET / POST requests for you. So if you need to trigger any webhooks on schedule, an AWS account and Cronyo is all you need:)
Key Features:
- Simple command line interface to manage cron jobs (much simpler than aws events put-rules, aws lambda add-permission, aws events put-targets , Cloudformation, or Terraform) Pre-built AWS Lambda functions for simple HTTP GET / POST requests, or use your own lambdas.
- Simple but Secure (HTTP GET / POST include an HMAC signature so you can validate the request is genuine).
-
cronyo add http_get '{"url": "https: / /example.com "} '--cron" 5 4 ? "
-
-
cronyo add http_post '{"url": "https: / /example.com "} '--rate 5 minutes --name my-cron-job
- Cost Effective (You’ll need a TON of cron rules to worry about costs).
Easy deployment of lambda functions using cronyo deploy . No need to twiddle with AWS.
read the blog post: Simple and Secure Cron using AWS Lambda
Cronyo takes the next step, and provides an automated solution with a CLI.
You will need an AWS account with the aws cli
installed. Then run:
Intro
- cronyo –help
- prints a help screen. cronyo configure . - Opens your editor so you can edit the config.json file. Use it to update your redis settings. cronyo preflight - Runs preflight checks to make sure you have access to AWS.
cronyo deploy
- deploys the code and configs to AWS automatically.
cronyo export - - exports all existing cron rules to yaml cronyo export --prefix - - exports all existing cron rules starting with prefix
to yaml
cronyo export - search - exports all existing cron rules matching the search string anywhere in the name
- sends an HTTP GET request to example.com at 4: 09 am every day cronyo disable cronyo - (a0b) d9b1d 2020 - disables cron with the name (cronyo) (a0b) d9b1d
cronyo enable cronyo - (a0b) d9b1d - enables cron with the name (cronyo) (a0b) d9b1d
cronyo delete cronyo - (a0b) d9b1d 2020 - deletes cron with the name (cronyo) (a0b) d9b1d
cronyo update http_get '{"url": "https: / /example.com "} '--cron" 5 4 ? "--name myrule - updates an existing rule
Names
cronyo creates a name for your cron jobs automatically (unless a custom name is specified). Names are required unique identifiers, and cannot be changed after creation (this is AWS limitation). Names can only contain certain characters.
cronyo comes with a (configurable) namespace - cronyo
by default. You can change the default using cronyo configure .
cron expressions
cronyo supports cron or rate expresssions. See the AWS docs
for specific info.
Note that - cron ”
won ' t work with quotes. This is because cron expressions include characters like which mess-up the CLI input.
adding a cron job
cronyo add http_get '{"url": "https://example.com"}' --cron "5 4 ? *" will send an HTTP GET request to example.com at 4: am every day cronyo add http_post '{"url": "https: / /example.com "} '--rate 5 minutes
will send an HTTP POST request to example.com every 5 minutes
cronyo add http_post '{"url": "https: / /example.com "," headers ": {" User-Agent ":" "}," cookies ": {" biscuit ":" oreo "}," params ": {" a ": "b"}, "data": {"key": "value"}} '--rate 5 minutes
will send an HTTP POST with custom cookies, headers, URL params and form data. cronyo add arn: aws: lambda: us-east-1 : 6731666938454: function: cronyo-http_post: live '{"url": "https://example.com"}' --rate 5 minutes
will call a lambda function with a specific ARN with given event paramaters every 5 minutes
using - name to provide a custom name (see Names above)
cronyo add http_post '{"url": "https: / /example.com "} '--rate 5 minutes --description" describe your cron job "
License using - - description
to provide a description for the job.
Cronyo is distributed under the MIT license. All 3rd party libraries and components are distributed under their respective license terms.
Copyright (C Yoav Aner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Read More
()
GIPHY App Key not set. Please check settings