This repository contains infrastructure and application code for a Serverless Workshop, which aims to provide a hands-on experience with serverless architecture using AWS services. The project utilizes AWS CDK (Cloud Development Kit) to define cloud infrastructure as code.
If you are working on a Windows machine, we recommend using Windows Subsystem for Linux (WSL).
Ensure the following tools are installed:
-
Start by cloning this repository:
git clone [email protected]:56kcloud/serverless-workshop.git cd serverless-workshop
-
Create a new branch with your UNIQUE team name:
git checkout -b <your-unique-team-name>
-
Define an environment variable with your team name:
export TEAM=$(git rev-parse --abbrev-ref HEAD)
-
Create a virtual Python environment and install dependencies:
python3.9 -m venv .venv source .venv/bin/activate pip install -r requirements-dev.txt
-
Run application unit tests:
python -m unittest tests/test_handler.py
Fix the failing tests if any.
-
Commit
git commit -a -m "Fixed unit tests"
-
Push
git push -u origin <your-unique-team-name>
-
Deploy
Open a browser and navigate to GitHub Actions to see the deployment progress.
https://github.com/56kcloud/serverless-workshop/actions
When the deployment completes, find the URL of the API you just deployed (look for the "Deploying" step in the workflow output logs), there should be block similar to:
Outputs: ProtectedApiStack.LambdaEndpoint = https://t95f7quxma.execute-api.eu-central-2.amazonaws.com/dev/
and copy/paste the url in a new browser window. You should see the following message:
{"message": "Welcome to the API <your-unique-team-name>!"}
🎉 Congratulations! You have deployed a Python API to the cloud using infrastructure-as-code and automation.
We welcome contributions to this project! Please fork the repository and submit a pull request for any changes or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.