AWS Pricing Calculator: A Step-by-Step Guide to Build a Scalable Cloud Cost Estimation Tool

1. Introduction

A web-based AWS Pricing Calculator platform designed to streamline AWS infrastructure cost estimation. It leverages HTML, CSS, and JavaScript for the frontend and integrates with AWS services like S3, Lambda, API Gateway, and Bedrock to handle backend processing, file storage, and AI capabilities.  

Users can effortlessly upload server configuration files through the interface, which are securely stored in an Amazon S3 bucket. Once processed, users can seamlessly download the generated pricing report directly from the website. 

The platform also features an intelligent Price BOT powered by Amazon Bedrock, allowing users to input server, storage, and database configuration requirements using natural language. The chatbot leverages generative AI models to extract relevant specifications from user queries and integrates with an AWS Lambda function to provide accurate, real-time AWS cost estimations. 

Key Features

  • AI-based Price BOT (supports multi-server queries) 
  • Dual Modes: File Upload & Query Interface 
  • Real-time cost estimation 
  • Secure file storage on AWS S3 
  • API Gateway integration
  • AWS Bedrock for AI-powered responses
  • Free & Premium access with Razorpay integration 

Technologies Used

Component        Technology Used 
Frontend HTML, CSS, JavaScript 
Backend AWS Lambda (Python) 
API Management AWS API Gateway 
AI Integration AWS Bedrock 
File Storage AWS S3 

2. Architecture Diagram 

3. Prerequisites

  • 1. AWS Account with administrator access to: S3, Lambda, API Gateway, Bedrock, IAM 
  • 2. Installed software: 
  • Python 3.9+ (for backend scripts) 
  • AWS CLI (configured with your AWS credentials) 
  • Git (for cloning the repository) 
  • 3. Required AWS services enabled: 
  • Amazon Bedrock (request access if not already enabled) 
  • Step 1: Frontend Setup: Develop UI using HTML, CSS, and JavaScript
  • Step 2: Create AWS S3 bucket: For storing files which triggers an event to invoke Extract Lambda Function for data extraction. 
  • Step 3: Deploy Lambda functions using AWS Console: 
  • runtime python 3.9+ (same for all functions, libraries and layers) 
  • role (create IAM roles and add required permissions) 
  • Create Extract Lambda Function – Reads files, extracts data, and storing the result file in S3 bucket. 
  • Create Cost Calculation Lambda Function – Matches configurations to EC2 instance types, fetches pricing details from AWS services and computes total estimated costs. 
  • Create Chatbot Lambda Function – Extracts requirements from user queries using Amazon Bedrock, and give responses to that queries. 
  • Create StoreData Lambda Function – Handle user verification, counter increment, payment verification and subscription status check. 
  • Step 4: Configure API Gateway 
  • Create a REST API in AWS API Gateway 
  • Set up POST endpoints to trigger Lambda functions 
  • Deploy the API and Update frontend with the API endpoint

4. AWS Services Used & Configurations 

AWS S3 (File Storage): Amazon S3 is used to securely store user-uploaded Excel or CSV configuration files. Once a file is uploaded, it automatically triggers an AWS Lambda function (Extract Lambda Function). The bucket also stores the processed output files (pricing results or error reports) which are later downloadable via the application. This ensures centralized, scalable, and reliable storage. 

AWS Lambda (Backend Processing): AWS Lambda functions serve as the core backend engine of the pricing calculator, automating everything from file parsing to pricing estimation, user validation, and subscription enforcement. 

Extract Lambda Function- This function is automatically invoked upon file upload to Amazon S3. It performs the following steps: 

  • Fetches the uploaded Excel/CSV file from the S3 bucket. 
  • Parses the file and uses regex to extract key configuration details like CPU and RAM specifications. 
  • Invokes the Cost Calculation Lambda function with the extracted data for pricing evaluation. 
  • Stores the resulting output (pricing CSV or error log) back to S3 with a timestamped filename. 

Cost Calculation Lambda Function- This function is responsible for determining monthly cost estimates based on user-specified infrastructure configurations. Key operations include: 

  • Receiving structured input (e.g., CPU, RAM, storage, and database type). 
  • Matching requirements against suitable EC2 instance types using the AWS EC2 API. 
  • Calling the AWS Pricing API to calculate cost for EC2 instances, storage (SSD, HDD), and database engines (MySQL, PostgreSQL, etc.). 
  • Returning detailed pricing data to the caller Lambda function (Extract Lambda Function or Chatbot Lambda Function). 

Chatbot Lambda Function- This function powers the backend of the AI-driven Price BOT chatbot. It: 

  • Uses Amazon Bedrock (e.g., Claude or Titan models) to extract structured infrastructure requirements from user queries written in natural language. 
  • Invokes the Cost Calculation Lambda function to generate real-time pricing estimates based on the extracted data. 
  • Returns human-readable and structured pricing insights back to the user interface. 

Store Lambda Function- This function manages user access and subscription logic: 

  • Verifies payments using Razorpay integration. 
  • Stores and manages user data and usage tracking (upload count, query count) in a PostgreSQL database. 
  • Validates user authentication and authorization. 
  • Enforces free tier limits and activates premium access upon successful payment. 
  • Tracks individual usage to restrict or allow further interactions. 

AWS API Gateway (Routing): (Secure API Routing) API Gateway exposes RESTful endpoints that connect the frontend web application with backend Lambda functions. It handles: 

  • Request validation and throttling. 
  • Authorization via tokens. 
  • Routing of chatbot queries, file processing requests, subscription verification, and payment interactions to appropriate Lambda functions. 

AWS Bedrock (AI Model): Foundation Model (Generative AI), Amazon Bedrock is used to interact with foundation models like Claude (Anthropic) or Titan (AWS) to: 

  • Parse and interpret free-form user input (e.g., “I need a server with 16 cores, 64 GB RAM, 1TB SSD, and PostgreSQL”). 
  • Convert it into structured JSON format that the backend cost engine (Cost Calculation Lambda Function) can process. 
  • Improve user experience with AI-driven intelligent understanding of infrastructure needs. 

5. Common Issues & Troubleshooting 

Issue    Solution 
API Gateway returns 403 Forbidden    Check if Lambda has the right execution role 
No response from chatbot    Check API endpoint in chat.js 
Bedrock AI not working    Ensure your AWS Bedrock model is deployed 
File upload not triggering Extract Lambda Ensure the correct S3 trigger is configured on the bucket and Lambda permissions allow invocation 

6. Conclusion

The AWS Pricing Calculator provides a smart, flexible, and efficient solution for estimating infrastructure costs using both file-based inputs and an AI-powered chatbot interface. It utilizes serverless architecture and natural language processing to provide an intuitive and efficient user experience. With built-in automation, usage tracking, and payment integration, the platform streamlines pricing workflows for developers, architects, and business decision-makers. 

By seamlessly integrating a simple frontend with powerful AWS backend services—such as Lambda, S3, API Gateway, and Amazon Bedrock—the system ensures accurate, scalable, and real-time cost estimation. Users can choose between uploading detailed configuration files or interacting with an intelligent Price BOT powered by generative AI. 

The platform provides: 

  • End-to-end automation, 
  • Usage-based quotas for both free-tier and premium users, 
  • PostgreSQL-based premium subscription tracking

This not only simplifies the pricing process but also showcases how AI can enhance cloud-native applications. The Price BOT is well-positioned to evolve into a comprehensive cloud cost advisory platform, laying the foundation for next-generation cloud financial management. 

By bridging generative AI with AWS’s serverless ecosystem, this solution demonstrates the transformative potential of intelligent automation in the domain of cloud economics

Scroll to Top