Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Orchestrating Lambda Functions Using AWS Step Functions

AWS Lambda functions can be integrated within Step Functions state machines to orchestrate workflow and create conditional logic. In this AWS hands-on lab, you’ll be building two Lambda functions and orchestrating the functions using Step Functions. Step Functions use numerical scores provided by students to determine the appropriate rewards to provide to the students by invoking the respective Lambda function. The orchestration of the workflow will rely on Step Functions calling the appropriate Lambda function depending on the inputted score.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 0m
Published
Clock icon Jan 27, 2023

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Set Up S3

    1. Create an S3 bucket and, inside the bucket, create two folders to host the files: guru-premium-courses and guru-premium-lessons.
    2. Download the CSV files from this lab's GitHub repository, and upload them to the respective folders created in the previous step.
  2. Challenge

    Create the Lambda Functions

    Create two Lambda functions as follows:

    First Lambda Function

    The function should return a response object consisting of the following:

    • A message congratulating the user on the high score; you can use the message below:

    "Well done. This was a hard quiz, and you nailed it! Here are your premium courses!"

    • A list of the premium courses that are retrieved from the respective S3 bucket.

    Second Lambda Function

    The function should return premium lessons after fetching them from the respective S3 bucket.

    • A message motivating the user to keep on practicing; you can use the message below:

    "You didn't pass. Don't worry! Practice makes perfect. Here are premium lessons to keep you going!"

    • A list of premium lessons that are retrieved from the respective S3 bucket.

    Note: Configure the IAM role of the functions to grant it access to S3.

  3. Challenge

    Set Up IAM Roles

    Create a new IAM role that will enable the Step Functions to trigger the Lambda functions.

  4. Challenge

    Set Up AWS Step Functions

    Create and test a new state machine that will take in a score from users. The orchestration should follow the logic below:

    • If the inputted score is less than 75, the state machine should trigger the Lambda function that will return the premium lessons.
    • If the inputted score is more than 74, the state machine should trigger the Lambda function that will return the premium courses.
    • Afterwards, the machine should terminate.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans