Skip to content

mmuppidi/apigateway-stepfunctions-sam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API gateway and step funtions integration example

The goal of this project is to show how to integrate AWS Stepfunctions with AWS API Gateway using AWS SAM. That is doing this using AWS SAM and cloud formation.

Using API gateway to invoke lambda function using SAM is very trivial, but to get the same working with step functions needs some work.

Architecture

Invoking stepfunctions via API gateway can be done in 2 ways, Synchronously and Asynchronously. In synchronous invokation API gatway returns actual result to the user, which in async invokation mode an execution ARN is returned. Execution ARN can be used to access the result one the execution is completed. The following diagram shows how above said invokations work.

Deploy the sample template

For uploading all the deployment artifacts create a s3 bucket or use an existing one. Export the name of the bucket as CF_BUCKET_NAME env variable

export CF_BUCKET_NAME=<bucket name>

This repo has a stack.yaml file which is a AWS SAM cloud formation template. Assuming that your awscli is properly configured use the following command to deploy the stack

chmod +x deploy.sh
./deploy.sh

This should deploy the stack in your AWS cloud account.

To inspect the cloud formation stack: log into AWS console > search for cloud formation page > you should find api-sfn-proto stack within this page.

To inspect the stack through SAM console: log into AWS console > search for lambda functions page > click on applications > you should find api-sfn-proto SAM model within this page.

Known issues

About

API Gateway and Step function SAM example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published