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

Building a Serverless Application Using Step Functions, API Gateway, Lambda, and S3 in AWS

In this AWS hands-on lab, we will create a fully working serverless reminder application using S3, Lambda, API Gateway, Step Functions, Simple Email Service, and Simple Notification Service. While the lab does use Python and JavaScript, you don't need to be able to code to understand and implement the solution. By the end of the lab, you will feel more comfortable architecting and implementing serverless solutions within AWS. Let's get started!

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 45m
Published
Clock icon Nov 20, 2020

Contact sales

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

Table of Contents

  1. Challenge

    Create the Lambda Functions

    You will need to create three Lambda functions for use in the Step Function using the resouces provided in the GitHub Repo.

    • Create an email reminder function called email using the contents of email_reminder.py. This function will require the use of a Simple Email Service (SES) verified email, so you will need to create and verify a new email identity in *SES When going into SES, do NOT click Get Started. Instead, click the three horizontal line icon in the top left and choose Verified identities to set up the email address.
    • Create a function called api_handler using the contents of api_handler.py. Please note that this function will require a Step Function ARN which will be created in the next objective.

    For all functions, you will need to utilize Python 3.8 and the LambdaRuntimeRole, which has been created with this lab environment.

  2. Challenge

    Create a Step Function State Machine

    Create a Step Function State Machine called MyStateMachine using the option to Write your workflow in code, and utilize the code provided in the step-functions-template.json file. For permissions, use the lab provided RoleForStepFunction role. The code is partially completed and will need to update to include your Email Reminder ARN from the Lambda function you created in the previous objective. Once the Step Function has been deployed, update your api_handler Lambda function to include the ARN for your Step Function.

  3. Challenge

    Create the API Gateway

    Create an API Gateway using REST API with the REST protocol. You will need to create a New API called reminders and ensure that you Enable API Gateway CORS. Once the API has been created, you will need to create a POST method for /reminders in the us-east-1 region that uses the api_hanlder function that was created earlier and deploy the API Gateway as a New Stage called prod.

  4. Challenge

    Create and Test the Static S3 Website

    Download a local copy of the static_website folder with its contents from the GitHub repo and modify the formlogic.js file to include the Invoke URL from your API Gateway. Make sure to keep /reminders at the end of the string. Once the file has been modified, create a web enabled S3 bucket with static website hosting enabled and upload the static_website folder to your S3 bucket. Use the Bucket website endpoint to access and test the functionality of the website by sending an email reminder to your SES verified email and verify you receive the message. Observe the visual workflow of the event in Graph Inspector for MyStateMachine in AWS Step Functions.

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