Git Product home page Git Product logo

sam-stepfunctions-sdk-integration's Introduction

AWS Step Functions - SDK Integrations

Infrastructure as code framework used: AWS SAM, ASL

AWS Services used: AWS Step functions, Amazon S3, Amazon Transcribe, Amazon Transcribe, Amazon Translate

Summary of the demo

This is a sample application which showcases how to use Step Functions with AWS SAM, SDK integrations and local testing using mock configs.

In this example you won't find any Lambda function, but instead direct calls from the state machine to the different AWS Services.

We are also showing how to test locally the state machine, using mock configs. Mock configs allows a developer to mock the output of service integrations that are present in a state machine.

Developers can provide a valid sample output from the service call API that is present in the state machine as mock data. This allows developers to test the behavior of the state machine in isolation.

In this demo you will see:

  • How to create a State Machine using ASL and the AWS SDK integrations
  • How to define a state machine using AWS SAM
  • How to transcribe an existing video/audio file and translate it into spanish
  • How to test locally a State Machine
  • How to create a MockConfigFile
  • How to run this automatically

This demo is part of a video series posted in FooBar Serverless channel. You can check the videos to see the whole demo.

Overview of the state machine

This state machine takes a video or audio in English, stored in an S3 bucket. Transcribe this file with Amazon Transcribe, then grabs the transcriptions and gets the transcript for the text using Amazon Transcribe. And finally with the transcribed text uses Amazon Translate to get the spanish version of the text.

StateMachine

Deploy this demo

We will be using AWS SAM and make sure you are running the latest version - at the time of writing, this was 1.37.0 (sam --version).

Deploy the project to the cloud:

sam deploy -g # Guided deployments

You will need to input the S3 bucket and object key where your audio/video file is stored.

Next times, when you update the code, you can build and deploy with:

sam deploy

To delete the app:

sam delete

Test locally

To test the state machine locally you will first need to download the step functions local docker image.

Following the user guide, you can either run Step Functions local as a JAR or as a Docker container. Steps below will focus on the docker container approach.

docker pull amazon/aws-stepfunctions-local

Then you can run all the tests in the makefile

On a terminal window, first start with running docker:

make run

On a different terminal window/tab, you can then run:

make all

Finally, you can check history of each execution by running:

make history

Check makefile for details

Links related to this code

sam-stepfunctions-sdk-integration's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.