This project demonstrates how to build a simple serverless application that connects
a local frontend (Streamlit) to a cloud backend (AWS Lambda) managed through Terraform.
-
Frontend – Streamlit App
Provides a simple web UI where the user can enter their name.
Sends HTTP requests to the backend via an API endpoint. -
Backend – AWS Lambda (Python)
Receives HTTP requests from API Gateway and returns a dynamic text response. -
Infrastructure as Code – Terraform
Automatically provisions the AWS Lambda function and API Gateway using code.
- The user opens the Streamlit app and enters their name.
- Streamlit sends an HTTP request to the API Gateway.
- The API Gateway forwards the request to the AWS Lambda.
- The Lambda processes the input and returns:
Hello <name> from AWS Lambda!
To demonstrate the full connection between:
- a local frontend (Streamlit),
- a serverless backend (AWS Lambda),
- and cloud infrastructure management (Terraform).
This setup is ideal for learning serverless architectures and Infrastructure as Code concepts.
pip install streamlit requestscd streamlit_app
streamlit run app.pycd terraform
terraform init
terraform applystreamlit-lambda-terraform-demo/
│
├── lambda/
│ └── lambda_function.py
│
├── streamlit_app/
│ └── app.py
│
└── terraform/
├── provider.tf
├── main.tf
└── outputs.tf
When you're done testing:
terraform destroyThis removes all AWS resources to avoid unnecessary costs.