π― DevOps is not just about learning tools; itβs about applying them to solve real-world problems. One of the best ways to build practical DevOps skills is by creating hands-on projects that demonstrate how different cloud services work together.
In this project, I built a serverless web application using core AWS services such as AWS Lambda, Amazon DynamoDB, CloudFront Distribution, Amazon S3, Route53, SSL certification and also integrating these different AWS services.
π AWS Services used to implement the project:
The application follows a serverless architecture, which means there are no servers to manage, and AWS automatically handles scaling and infrastructure management.
Amazon S3 will host the static website
AWS Lambda will run the backend logic that processes user requests.
DynamoDB as database
Route53 for DNS name resolution
created CloudFront distribution to speed up the data delivery
Created SSL certificate using Amazon certificate manager and attach it to CloudFront (for HTTPS secure connection)
Github Repo for source code: https://github.com/Nandan3/Projects_on_AWS_Lambda
π About AWS Lambda:
β What AWS Lambda does:
- A serverless compute service that lets you run code without provisioning or managing servers.
- Runs code without servers - You donβt manage EC2 instances.
- Automatically scales depending on the amount of user traffic.
- Integrates with other AWS services - S3, DynamoDB, CloudWatch, SNS, SQS, API Gateway, etc.
- Supports popular programming languages like Python, Java, C#, Node.js, Go, Ruby, Power shell.
- It has runtime API extension that allows you to use other programming language not listed.
β How It Works (Flow):
- Lambda starts with an events, which triggers lambda to do something or execute the code.
- Source of the event is another AWS services like S3, API Gateway. It can be trigger from stream of data or queue, like Kinesis Data Streams or Simple Queue Service.
π About Dynamo DB:
β
Intro:
- Managing and scaling NoSQL DB for web application and services.
- Replicates data across multiple AWS Regions automatically.
β Features:
- NoSQL data: Key-value and document-style storage.
- Provides us fully managed serverless and highly available DB
- Handle high traffic applications
- Works with Lambda, API Gateway, Step Functions, etc.
- Secure - Encryption, IAM-based access control, and VPC integration.
β Dynamo DB - Components:
- Tables: place to store data or collection of data
- Items: each table contains zero or more items. Entry into the table.
- Attributes: items composed of one or more attributes. Like properties within table.
β Use cases:
- Building internet scale applications, which supports user content, metadata and caches that require high concurrency and connections for millions of users and millions requests per seconds.
- Also great for workloads that are used within real time video streaming and interactive content because it delivers low latency with multi-region replication.
Project Architecture:
π― Detailed guide for implementing the project:
π Steps to Configure S3:
β Step 1:
- Go to S3 in AWS Console
- Create S3 bucket with proper configuration set up. Name: Serverless-web-application Type: Private S3 bucket Server-side encryption with Amazon S3 managed keys (SSE-S3)
β Step 2:
- Upload HTML, Java script, CSS files into S3 bucket
π Steps to configure CloudFront Distribution:
- CloudFront is secure content delivery service in AWS and reduce the latency, ensures high data transfer speed.
β Step 1:
- Go to CloudFront >> create Distributions Origin type: Amazon S3 S3 Origin: serverless-web-application-using-lambda.s3.ap-south-1.amazonaws.com (select from dropdown)
β
Step 2:
Copy S3 bucket policy, which you need to attach to bucket. So that CloudFront can access the S3.
Go to CloudFront >> click on the distribution, which you created now >> select "Origin" >> select "origin name (severless-web-application)" >> Edit.
β
Step 3:
Copy the CloudFront Policy
β
Step 4:
Go to S3 bucket >> Permissions >> bucket policy >> paste the policy, which you copied
This allows the CloudFront Service principle to access S3 bucket
β
Step 5:
Make sure that the default root object is "index.html" in cloud front. Because in S3 - "index.html" is the entry point to our application.
π Enable Route53 for CloudFront Distribution
β
Step 1:
- Purchase your own DNS name from GoDaddy or Route53 itself.
- Then create Hosted zone by using DNS name in Route53 (if the DNS name is purchased from external).
β Step 2:
- Inside CloudFront distribution >> origin >> add DNS name and select custom SSL certificate (if don't have request the certificate in Amazon ACM).
Add DNS record and SSL certificate into CloudFront
- To request SSL certificate >> go to Amazon ACM >> request a certificate with "*.nandanwithtech.in" domain name.
- Validate the certificate with Route53 for that: click on the certificate >> under "Domain" section >> create records in Route53 >> proceed.
A CNAME record will be created under Route53
β Step 3:
- Create Route53 record for "serverless" subdomain in serverless.nandanwithtech.in
Now try to access the application with registered DNS name with "secure https": https://serverless.nandanwithtech.in/
π Steps to Create DynamoDB tables and map it with Lambda functions
- Create a Dynamo DB table and make sure to create an IAM role for the Lambda function to give permission to access DynamoDB table.
β Step 1:
- As we see in the web application, whenever any person enter his/her name and submit the details and refresh the page, view count should be increased.
- For this, I'm creating Dynamo DB table in AWS and adding the Id, view items into the table.
β Step 2:
- Create an IAM role and give permissions to Lambda functions to access dynamoDB. Go to IAM >> Role >> create role
- Here I ensured the "least priviliged access" control mechanism, by giving only required permissions through policy and attached it to role.
π Creating a Lambda function and integrating with the website
β Step 1:
- Go to Lambda >> create Lambda function Name: serverless-web-app-lambda Language: Python 3.14 Enable function URL to assign HTTPS to Lambda function
proceed with the Lambda function
Function URL: https://atzqihljt3dupct4orlsbjm5yi0qwgrl.lambda-url.ap-south-1.on.aws/
- Add IAM role to Lambda function to access Dynamo DB Go to Lambda function >> configuration >> Permissions >> click on Edit >> choose execution role.
- Update the code into Lambda function >> Test the code
- Access the website using secure domain name - https://serverless.nandanwithtech.in/
π Error during implementation:
Solution: Add PutItem permission in IAM policy




























Top comments (0)