Call an AWS Fargate microservice with Amazon API Gateway

This demonstrates how to use AWS Step Functions to make a call to Amazon API Gateway to interact with a service on AWS Fargate and to check whether the call succeeded.

In this project, Step Functions calls an API Gateway endpoint, checking the response status code, and notifying a specified SNS topic of the success or failure of the API call.
The project involves the following steps:
Calls an API Gateway HTTP endpoint using an IAM role for authentication.
Checks if the response status code is 200 using a Choice state.
If the response status code is 200, publishes a success message to an SNS topic using a Task state.
If the response status code is not 200, publishes a failure message to the same SNS topic using a Task state.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/call-microservice-apigw/cd step-functions-workflows-collection/call-microservice-apigw

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Additional resources

Created by:

Mohamed Salah

Mohamed Salah

Solution Architect with 15 years of experience in IT, leading solution design and project delivery of complex enterprise multi-tier distributed architectures. Expertise in digital transformation and IoT across different industries - public sector, telecommunication and transportation.

Follow on LinkedIn