In this challenge, you will use Serverless Functions to build a serverless API. All major cloud providers offer Serverless Functions, a compute service that lets you run code without provisioning or managing servers. You can use these to build many applications, including APIs, web applications, and mobile backends.
The following are the services:
- A cloud provider account (AWS, Azure or GCP)
- Knowledge of Python or another programming language supported by these services.
- IaC Tool like Terraform or Pulumi
- CICD: Continuous Integrations and Continuous Deployment
Here are some examples of serverless APIs that you can build with AWS Lambda:
- A simple API for your favorite TV Show (see below for reference)
- An API that fetches data from a database
- An API that processes images or videos (see below an example of QR Code Generator)
- An API that triggers other AWS services, such as Amazon Simple Notification Service (SNS) or Amazon Simple Email Service (SES)
- Create a Serverless function. You can do this using the cloud management console or the cloud provider CLI.
- Write the code for your function. Your function should handle incoming HTTP requests and return a response.
- Deploy your function to the cloud.
- Create an API Gateway resource or HTTP trigger and configure it to trigger your Serverless function.
- Test your API by sending HTTP requests to the API Gateway resource.
- Write IaC for your Serverless Function so that you can use code to deploy it. You can use any one of the following: Terraform or Pulumi.
- Set up a GitHub repository where you will push your serverless function code and IaC code.
- Set up a CICD pipeline using GitHub Actions or a tool of your choice to deploy your Function if a push or change is made to the code in the repo.
Here are a few example ideas of what you can build.
Would you be interested in a beginner-friendly cloud serverless project? I have one for you. AWS Lambda Resume API Challenge. A project where you can build and deploy a serverless API using AWS Lambda and DynamoDB, integrated with GitHub Actions. The primary goal? Construct an API that can serve resume data in JSON format.
I have a GitHub repo where you can submit your solutions! Link to the GitHub Repo
I built an API using AWS Lambda that accepts POST requests with a URL field in the body and generates a QR Code for the provided URL, saves the QR Code in the S3 bucket, and then sends back the QR Code S3 Object with 200 OK response.
An API for my favorite TV Show, the Peaky Blinders. This was built as FastAPI in Python, but you can convert it into a Serverless Lambda API. It has a different endpoint that you can send GET requests to show data like:
- Cast
- Seasons
- Episodes
Serverless Functions are a powerful tool for building serverless APIs. Following this challenge's steps, you can learn how to build your serverless API with AWS, Azure, or GCP.
Have fun and learn during this Week 8 Challenge! 🤗