GithubHelp home page GithubHelp logo

sathishkumarmca / aws-step-functions-iterate-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from christianklotz/aws-step-functions-iterate-sample

0.0 1.0 0.0 10 KB

Sample project demonstrating iteration with AWS Step Functions

License: Apache License 2.0

Go 100.00%

aws-step-functions-iterate-sample's Introduction

AWS Step Functions Iteration Sample

A complete serverless stack demonstrating how to process an arbitrary number of jobs using AWS Step Functions. This is the sample project to the article Processing an arbitrary number of jobs with AWS Step Functions.

Prerequisites

In order to build, deploy and run this sample app you'll need an AWS account and the following tools installed on your machine.

Make sure to clone the repository into your $GOPATH.

Build

Get all dependencies and build the Lambda functions for the Amazon Linux.

go get ./cmd/...

GOOS=linux go build -o ./cmd/move-to-end/move-to-end ./cmd/move-to-end
GOOS=linux go build -o ./cmd/process-execute/process-execute ./cmd/process-execute

Deploy

sam package --template-file ./template.yaml \
  --s3-bucket <S3_BUCKET> \ 
  --output-template-file ./template.packaged.yaml

aws cloudformation deploy --template-file "$(PWD)/template.packaged.yaml" \
  --stack-name <STACK_NAME> \
  --capabilities CAPABILITY_NAMED_IAM

Run

The workflow is started by process-execute, passing the input data to the state machine.

{
  "guid": "execution-id",
  "jobs": [{
    "guid": "execution-id-0",
    "input": "First job",
    "done": false
  }, {
    "guid": "execution-id-1",
    "input": "Second job",
    "done": false
  }]
}

Alternatively, start an execution using the AWS CLI and the correct state machine arn.

aws stepfunctions start-execution --state-machine-arn <STATE_MACHINE_ARN> \
  --input "{\"jobs\": [{\"input\": \"First job\", \"done\": false}, {\"input\": \"Second job\", \"done\": false}]}"

aws-step-functions-iterate-sample's People

Watchers

 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.