Cloud Project Detail

CompletedBeginnerServerless Computing

AWS Serverless Contact Event Logger

A serverless AWS Lambda application that processes contact form requests through a Function URL and logs execution details to CloudWatch.

4Cloud Services
5Steps
2Videos

Problem

Traditional web applications require servers to process simple form submissions, increasing infrastructure management overhead.

Solution

Implemented a serverless AWS Lambda function that receives and processes contact form requests through a Lambda Function URL.

Goal

Learn AWS Lambda, serverless architecture, CloudWatch monitoring, and Function URL integration.

Target Users

Developers and cloud learners interested in event-driven serverless applications.

Cloud Services Used

AWS LambdaAmazon CloudWatchIAMLambda Function URL

Tools Used

PythonAWS ConsolePostmanBandicamGitHub

Architecture Overview

The application exposes a Lambda Function URL that accepts HTTP POST requests. Lambda validates and processes the JSON payload, then logs execution details to CloudWatch.

  • - Client sends POST request
  • - Lambda Function URL receives request
  • - AWS Lambda validates payload
  • - Lambda processes event
  • - CloudWatch stores execution logs
  • - Response returned to client

Steps Taken

Create AWS Lambda Function

Created a Python-based Lambda function using the AWS Management Console.

Implement Request Processing Logic

Added JSON parsing and validation for incoming contact form requests.

Configure Function URL

Exposed the Lambda function through a public HTTPS endpoint using Lambda Function URLs.

Test Using Postman

Sent HTTP POST requests and verified successful responses.

Monitor with CloudWatch

Verified execution logs and request data using Amazon CloudWatch Logs.

Videos

Project Walkthrough

Complete walkthrough of building and configuring the AWS Lambda project.

Lambda Function Demonstration

Demonstration of request processing and CloudWatch logging.

Challenges

Issue: Understanding Lambda Function URLs

Cause: First exposure to serverless HTTP endpoints.

Solution: Configured and tested Function URLs through the AWS Console.

Lesson Learned: Serverless applications can expose APIs without managing web servers.

Issue: Monitoring execution

Cause: Need to verify requests were being processed.

Solution: Used CloudWatch Logs to inspect execution details.

Lesson Learned: Monitoring is a critical component of cloud applications.

Mistakes

Mistake: Initially focused only on code execution.

Fix: Added CloudWatch log verification.

Lesson: Cloud projects should include monitoring and observability.

Security Considerations

Topic: Public Function URL

Explanation: The Function URL was configured for public access to simplify testing.

Improvement: Restrict access using IAM authentication or API Gateway.

Topic: IAM Permissions

Explanation: Lambda uses an execution role to write logs to CloudWatch.

Improvement: Apply least-privilege permissions for production deployments.

Cost Considerations

Service: AWS Lambda

Estimated Cost: Within Free Tier

Notes: Lambda provides generous free monthly request and execution limits.

Service: Amazon CloudWatch

Estimated Cost: Minimal

Notes: Log usage remains low for small projects and testing environments.

Lessons Learned

  • - How AWS Lambda executes code without provisioning servers.
  • - How to expose serverless applications using Lambda Function URLs.
  • - How CloudWatch Logs can be used for monitoring and troubleshooting.

Future Improvements

  • - Store submissions in DynamoDB
  • - Send notifications using Amazon SNS
  • - Integrate with a CodeIgniter 4 application running on EC2
  • - Protect endpoints using API Gateway and IAM authentication
  • - Implement CI/CD deployment using GitHub Actions

Related Learning Logs