Brief

In this first challenge, we will create the foundations of the backend of company XYZ’s warehouse management system.

We will be creating our very first serverless framework project. When you do this in other frameworks, one of the first commands you’ll learn is to run the project locally. But in Serverless Framework, it’s different, we deploy first. Another thing we need to learn is how to debug your application once its deployed. When your app is running locally, you get the logs right away. When you have serverless applications, its log is in a separate service called CloudWatch Logs.

We’ll introduce how to run your app locally in Challenge 5.

About Cloud 9

Screenshot 2025-02-22 at 8.32.49 AM.png

Section A: Create your first serverless project - 5pts

  1. Create your first serverless framework project by using the serverless command. Choose the AWS / Python / HTTP API template by pressing the arrow down key multiple times. Then, press enter.

    Screenshot 2025-02-22 at 8.19.18 AM.png

  2. Name your project “python-serverless-{team_name}”. Then, press enter

    Screenshot 2025-02-22 at 8.20.19 AM.png

  3. You should see success!

    Screenshot 2025-02-22 at 8.20.45 AM.png

  4. By default, we are at the ~/environment folder. Use the ls command to see what folders/files are inside this directory.

    Screenshot 2025-02-22 at 8.32.14 AM.png

  5. We see that our newly created project has a directory of the same name. So let’s jump into that and shift our terminal to use that directory. Use the cd python-serverless-{team_name} command to do so. Be sure ofcourse to replace {team_name} with your team name. Then, do ls command again.

    Screenshot 2025-02-22 at 8.36.11 AM.png

Section B: Customizing your app + deploying it - 5pts

  1. On the directory pane, double click the “python-serverless-{team_name}” folder (the folder of the project you just created). It should expand as below. Then, double click “serverless.yml”.

    Screenshot 2025-02-22 at 8.38.04 AM.png

  2. In your serverless.yml file, replace the provider section with the snippet below. Make sure to save the file using the CTRL+S command.

    provider:
      name: aws
      runtime: python3.12
      role: arn:aws:iam::272898481162:role/serverless-app-role