Mastering Service Integration Patterns with AWS Step Functions

Mastering Service Integration Patterns with AWS Step Functions
Mastering Service Integration Patterns with AWS Step Functions

CLOUD LABS



Mastering Service Integration Patterns with AWS Step Functions

In this Cloud Lab, you’ll explore how to use AWS Step Functions service integration patterns to handle various job types: short jobs, long-running jobs whose results impact subsequent states, and jobs requiring external verification before transitioning to the next state.

9 Tasks

intermediate

2hr

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

Hands-on experience setting up AWS Step Functions state machine
The ability to set up service integration patterns in AWS Step Functions
A basic understanding of use cases of AWS Step Functions service integration patterns
Working knowledge of creating an ETL Glue pipeline

Technologies
Step Functions
Glue
Lambda logoLambda
S3 logoS3
Cloud Lab Overview

AWS Step Functions is a serverless orchestration service that lets you coordinate multiple AWS services into fully managed workflows using a state machine. It simplifies building applications by allowing developers to define workflows using a JSON-based language. With AWS Step Functions, you can automate business processes, manage complex microservices architectures, and orchestrate tasks across AWS services using service integration patterns. Service integration patterns of AWS Step Functions provide tailored approaches based on the type of job or task at hand:

  • Request Response: This is used for tasks that respond immediately to the request. For example, a service calls a Lambda function and waits for its result before proceeding to the next step.

  • Run a Job: This is used for long-running jobs. It waits for job completion (like an AWS Glue ETL job) and proceeds.

  • Wait for Callback: This method is used when a task initiates a process and waits for an external entity to send a token when the task completes. It is commonly used with services that require manual approval or multistep processes.

In this Cloud Lab, you’ll use the three service integration patterns in the following way:

Using combinations of Request Response, Run a Job, and Wait for Callback service integration patterns in AWS Step Functions
Using combinations of Request Response, Run a Job, and Wait for Callback service integration patterns in AWS Step Functions

You’ll create the S3 bucket in this Cloud Lab and add a data file. You will then create IAM roles that will provide the necessary permissions for the Lambda functions, Glue ETL job, and AWS Step Functions. After that, you will create a Lambda function that checks whether the file is in the S3 bucket. You will create an AWS Glue ETL job to filter out the desired data from the data file in the S3 bucket. Finally, you’ll create a Lambda function that validates the transformations in the data.

After creating the necessary resources, you’ll create a state machine in AWS Step Functions and use the service integration patterns in the following three ways, as shown in the architecture diagram above:

  • First, you will use the Request Response service integration pattern for all the states. However, this approach will fail as the Glue ETL job takes longer to execute, and the state machine does not wait for its completion.

  • Afterward, you will use the Run a Job service integration pattern with the AWS Glue ETL job to transform the data. The Run a Job service integration pattern waits for the job to complete and switches the state machine to the next state only when we get results.

  • Finally, we will remove the ETL job from the state machine and run it externally. We will use the Wait for Callback service integration pattern for the Lambda function, which checks the file’s presence to hold its output to the next state. We will run the Glue ETL job externally and then, after its completion, manually verify whether the task has been completed successfully for the state machine to switch to the next state.

Cloud Lab Tasks
1.Introduction
Getting Started
2.Create Necessary Resources for the Workflow of AWS Step Functions
Create an S3 Bucket
Create IAM Roles
Create Lambda Functions
Set Up a Visual ETL Pipeline with AWS Glue
3.AWS Step Function Service Integration Patterns
Set Up the Request Response Service Integration Pattern
Set Up Run a Job and Callback Service Integration Patterns
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Relevant Courses

Use the following content to review prerequisites or explore specific concepts in detail.

Trusted by 1.4 million developers working at companies including

Don’t take our word for it. See what our developers have to say.

Your method is simple, straight to the point and I can practice with it everywhere, even from my phone, that's something I have never had in other learning platforms.

Felipe Matheus
TestimonialsImg

I highly recommend Educative. The courses are well organized and easy to understand.

Adina Ong
TestimonialsImg

I prefer Educative courses because they have a nice mix of text & images. I find that with full video courses, it can often be too easy to go into passive learning mode.

Clifford Fajardo
TestimonialsImg

I prefer Educative courses because they have a nice mix of text & images. I find that with full video courses, it can often be too easy to go into passive learning mode.

Clifford Fajardo
TestimonialsImg
Don’t take our word for it. See what our developers have to say.

Your method is simple, straight to the point and I can practice with it everywhere, even from my phone, that's something I have never had in other learning platforms.

Felipe Matheus
TestimonialsImg

I highly recommend Educative. The courses are well organized and easy to understand.

Adina Ong
TestimonialsImg

I prefer Educative courses because they have a nice mix of text & images. I find that with full video courses, it can often be too easy to go into passive learning mode.

Clifford Fajardo
TestimonialsImg

Get access to Educative Cloud Labs

Course Footer Image
Course Footer Image