GithubHelp home page GithubHelp logo

mhmdryhn / aws_step_functions_with_cloudwatch_and_lambda Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 21 KB

Triggering AWS Step Functions from CloudWatch rule to execute a series of Lambda Functions based on condition.

License: MIT License

Python 23.18% HCL 76.82%
aws aws-step-functions aws-cloudwatch-events aws-lambda aws-statemachine aws-states-language

aws_step_functions_with_cloudwatch_and_lambda's Introduction

AWS Step Functions with Cloudwatch and Lambda

Triggering AWS Step Functions from CloudWatch rule to execute a series of Lambda Functions based on condition. Rules are cron jobs and set using Cloudwatch event rule. At some specified time it triggers the Step Function. The execution flow is as follows:

  1. Cloudwatch rule triggers step function (the state machine).
  2. Initial state fires a lambda named collector_lambda.
  3. Collector lambda executes its job and then pass its output to the next state.
  4. This state decides based on the output of the collector_lambda which lambda to call next.
  5. Based on the decision of the state, either the sender_lambda or rejection_lambda is fired.
  6. The fired lambda returns output and the state machine reach its end.

Commands To Manipulate Resources

First enter into terraform directory to run the following commands.

  • Installs required terraform plugins. See more details here
terraform init
  • View execution plan
terraform plan --var-file input_value.tfvars
  • Apply the configurations
terraform apply --var-file input_value.tfvars --auto-approve

Remove --auto-approve option from the above command to approve manually (by inputting prompt).

If the input file is named exactly terraform.tfvars or any variation of *.auto.tfvars, those will be loaded automatically, you don't need to pass --var-file option with the command. In this case the command is as following.

terraform apply --auto-approve

And, the JSON version of the input files follows the same above rules.

  • Destroy all resources
terraform destroy --var-file input.tfvars --auto-approve

Remove --auto-approve option from the above command to approve manually (by inputting prompt).

aws_step_functions_with_cloudwatch_and_lambda's People

Contributors

mhmdryhn avatar

Watchers

 avatar  avatar

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.