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.
~/environment
folder.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.
Name your project “python-serverless-{team_name}”. Then, press enter
You should see success!
By default, we are at the ~/environment
folder. Use the ls
command to see what folders/files are inside this directory.
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.
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”.
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