Giter Site home page Giter Site logo

aws-scheduler's Introduction

AWS Scheduler

AWSScheduler is a scheduling system used to invoke any lambdas using EventBridge rule. You can find out about supported schedulerExpression from https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html

The design of this functionality is originated from https://aws.amazon.com/blogs/mt/build-scheduler-as-a-service-amazon-cloudwatch-events-amazon-eventbridge-aws-lambda/. However, this has an additional cleanup function that will try to clean up expiring rule, so you won't run into the issue of having unused scheduling rules.

How to use

Example of making a request to schedule another lambda

curl --location --request POST 'https://bv8zd56pw1.execute-api.us-east-1.amazonaws.com/aws-scheduler-lambda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "schedulerExpression": "cron(5 17 11 4 ? 2021)",
    "targetFunctionName": "aws_scheduler_cleanup",
    "target": {
        "id": "aws_scheduler_cleanup",
        "arn": "arn:aws:lambda:us-east-1:108317574226:function:aws_scheduler_cleanup",
        "input": "{ \"data\": \"Just some random data\" }"
    }
}'

targetFunctionName must be equal to target.id

Deployment

This deployment script assumes that you use terraform and already setup correct permission for terraform to run.

Deploy

./deploy-script.sh

Tear down

./tear-down-script.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.