💰 Save money on AWS with an automated cost optimization tool!
This Lambda function identifies underutilized resources and provides actionable recommendations to reduce your cloud bill.
✅ EC2 Analysis: Detects EC2 instances with low CPU utilization.
✅ RDS Analysis: Identifies RDS instances with low CPU usage.
✅ S3 Analysis: Suggests storage class transitions for cost savings.
✅ Automated Alerts: Sends cost-saving recommendations via AWS SNS.
Before you begin, ensure you have:
- ✅ An AWS Account with necessary permissions.
- ✅ AWS CLI installed and configured.
- ✅ A Python 3.x environment.
- ✅ The Boto3 library installed (
pip install boto3). - ✅ An SNS Topic ARN for notifications.
git clone https://github.com/yourusername/CostOptimizationWithAWSLambda.git
cd CostOptimizationWithAWSLambdapip install -r requirements.txt- 🔹 Create a new Lambda function in the AWS Console.
- 🔹 Set the runtime to Python 3.x.
- 🔹 Upload
lambda_function.pyas the function code. - 🔹 Set the environment variables
SNS_TOPIC_ARN,ASSUMABLE_ROLE_NAME,PDF_REPORT_BUCKET. - 🔹 Assign IAM roles with permissions for EC2, RDS, S3, and SNS.
- 🚀 Deploy the Lambda function.
- 🔄 Trigger manually or via CloudWatch Scheduled Events.
- 📩 Receive cost-saving recommendations via SNS notifications.
This project is licensed under the MIT License. See the LICENSE file for details.
💡 Pro Tip: Set up a CloudWatch event to trigger this function regularly for continuous cost savings! 🔄💰